aboutsummaryrefslogtreecommitdiff
path: root/files/pt-pt/tools/style_editor/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-pt/tools/style_editor/index.html')
-rw-r--r--files/pt-pt/tools/style_editor/index.html111
1 files changed, 111 insertions, 0 deletions
diff --git a/files/pt-pt/tools/style_editor/index.html b/files/pt-pt/tools/style_editor/index.html
new file mode 100644
index 0000000000..63bb52bba4
--- /dev/null
+++ b/files/pt-pt/tools/style_editor/index.html
@@ -0,0 +1,111 @@
+---
+title: Editor de Estilo
+slug: Tools/Editor_de_estilo
+tags:
+ - CSS
+ - Desenvolvimento da Web
+ - 'Desenvolvimento da Web: Ferramentas'
+ - Ferramentas
+ - Folhas de estilo
+translation_of: Tools/Style_Editor
+---
+<div>{{ToolsSidebar}}</div><p>O Editor de Estilo permite-lhe:</p>
+
+<ul>
+ <li>view and edit all the stylesheets associated with a page</li>
+ <li>create new stylesheets from scratch and apply them to the page</li>
+ <li>import existing stylesheets and apply them to the page</li>
+</ul>
+
+<p>{{EmbedYouTube("7839qc55r7o")}}</p>
+
+<p>To open the Style Editor choose the "Style Editor" option from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac). The <a href="https://developer.mozilla.org/en-US/docs/Tools/DevTools_Window" title="/en-US/docs/Tools/DevTools_Window">Toolbox</a> will appear at the bottom of the browser window, with the Style Editor activated:</p>
+
+<p><img alt="" src="https://mdn.mozillademos.org/files/6941/style-editor.png" style="display: block; height: 238px; margin-left: auto; margin-right: auto; width: 816px;"></p>
+
+<p>O Editor de Estilo está dividido em três secções principais:</p>
+
+<ul>
+ <li><a href="/en-US/docs/Tools/Style_Editor#The_style_sheet_pane">the style sheet pane on the left</a></li>
+ <li><a href="/en-US/docs/Tools/Style_Editor#The_editor_pane">the editor on the right</a></li>
+ <li><a href="/en-US/docs/Tools/Style_Editor#The_media_sidebar">the media sidebar.</a></li>
+</ul>
+
+<h2 id="O_painel_de_folha_de_estilo">O painel de folha de estilo</h2>
+
+<p>The style sheet pane, on the left, lists all the style sheets being used by the current document. You can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to the left of the sheet's name. You can save any changes you've made to the style sheet to your local computer by clicking the Save button in the bottom-right corner of each sheet's entry in the list.</p>
+
+<p>From Firefox 40 onwards, the style sheet pane also includes a context menu that lets you open the selected style sheet in a new tab.</p>
+
+<h2 id="O_painel_do_editor">O painel do editor</h2>
+
+<p>On the right is the editor pane. This is where the source for the selected style sheet is available for you to read and edit. Any changes you make are immediately applied to the page. This makes it easy to experiment with, revise, and test changes. Once you're satisfied with your changes, you can save a copy locally by clicking the Save button on the sheet's entry in the style sheet pane.</p>
+
+<p>The editor provides line numbers and syntax highlighting to help make it easier to read your CSS. It also supports a number of <a href="/en-US/docs/Tools/Style_Editor#Source_editor_shortcuts">keyboard shortcuts</a>.</p>
+
+<p>The Style Editor automatically de-minimizes style sheets that it detects, without affecting the original. This makes it much easier to work on pages that have been optimized.</p>
+
+<p>The Style Editor supports autocomplete. Just start typing, and it will offer you a list of suggestions.</p>
+
+<p><img alt="" src="https://mdn.mozillademos.org/files/6943/style-editor-autocomplete.png" style="display: block; margin-left: auto; margin-right: auto;">You can switch autocomplete off in the <a href="/en-US/docs/Tools_Toolbox#Style_Editor">Style Editor settings</a>.</p>
+
+<h2 id="A_barra_lateral_de_multimédia">A barra lateral de multimédia</h2>
+
+<p>The Style Editor displays a sidebar on the right-hand side whenever the current sheet contains any <a href="/en-US/docs/Web/Guide/CSS/Media_queries"><code>@media</code> rules</a>. The sidebar lists the rules and provides a link to the line of the sheet where the rule is defined. Click an item to jump to that rule in the sheet. The condition text of the rule is greyed-out if the media query doesn’t currently apply.</p>
+
+<p><img alt="" src="https://mdn.mozillademos.org/files/8365/style-editor-media-sidebar-detail.png" style="display: block; margin-left: auto; margin-right: auto;">The media sidebar works especially well with <a href="/en-US/docs/Tools/Responsive_Design_View">Responsive Design View</a> for creating and debugging responsive layouts:</p>
+
+<p>{{EmbedYouTube("aVUXmvLSwoM")}}</p>
+
+<p>From Firefox 46 onwards, if an <code>@media</code> rule contains a screen size in a condition, then it is made clickable: clicking it then resizes the screen to that size using the Responsive Design View:</p>
+
+<p>{{EmbedYouTube("XeocxoW2NYY")}}</p>
+
+<h2 id="Criação_e_importação_das_folhas_de_estilo">Criação e importação das folhas de estilo</h2>
+
+<p>You can create a new style sheet by clicking the New button in the toolbar. Then you can just start entering CSS into the new editor and watch as the new styles are applied in real time just like changes to the other sheets.</p>
+
+<p>You can load a style sheet from disk and apply it to the page by clicking the Import button.</p>
+
+<h2 id="Source_map_support">Source map support</h2>
+
+<p>{{EmbedYouTube("zu2eZbYtEUQ")}}</p>
+
+<p>Web developers often create CSS files using a preprocessor like <a href="http://sass-lang.com/">Sass</a>, <a href="http://lesscss.org/">Less</a>, or <a href="http://learnboost.github.io/stylus/">Stylus</a>. These tools generate CSS files from a richer and more expressive syntax. If you do this, being able to see and edit the generated CSS is not so useful, because the code you maintain is the preprocessor syntax, not the generated CSS. So you'd need to edit the generated CSS, then manually work out how to reapply that to the original source.</p>
+
+<p>Source maps enable the tools to map back from the generated CSS to the original syntax, so they can display, and allow you to edit, files in the original syntax. From Firefox 29 onwards, the Style Editor can understand CSS source maps.</p>
+
+<p>This means that if you use, for example, Sass, then the Style Editor will show you, and allow you to edit, Sass files, rather than the CSS that is generated from them:</p>
+
+<p><img alt="" src="https://mdn.mozillademos.org/files/6939/style-editor-sourcemap-820.png" style="display: block; margin-left: auto; margin-right: auto;">For this to work, you must:</p>
+
+<ul>
+ <li>use a CSS preprocessor that understands the <a href="https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit">Source Map Revision 3 proposal</a>. Currently this means <a href="http://sass-lang.com/">Sass</a> 3.3.0 or above or the <a href="http://roots.io/using-less-source-maps/">1.5.0 version of Less</a>. Other preprocessors are actively working on adding support, or considering it.</li>
+ <li>actually instruct the preprocessor to generate a source map, for example by passing the <code>--sourcemap</code> argument to the Sass command-line tool</li>
+</ul>
+
+<h3 id="Visualização_das_fontes_originais">Visualização das fontes originais</h3>
+
+<p>Now, if you check "Show original sources" in the <a href="/en-US/docs/Tools_Toolbox#Style_Editor">Style Editor settings</a>, the links next to CSS rules in the <a href="/en-US/docs/Tools/Page_Inspector#Rules_view">Rules view</a> will link to the original sources in the Style Editor.</p>
+
+<p>From Firefox 35 onwards original sources are displayed by default.</p>
+
+<h3 id="Edição_das_fontes_originais">Edição das fontes originais</h3>
+
+<p>You can also edit the original sources in the Style Editor and see the results applied to the page immediately. To get this to work there are two extra steps.</p>
+
+<p>First, set up your preprocessor so it watches the original source and automatically regenerates the CSS when the source changes. With Sass you can do this simply by passing the <code>--watch</code> option:</p>
+
+<pre>sass index.scss:index.css --sourcemap --watch</pre>
+
+<p>Next, save the original source in the Style Editor by clicking the "Save" button next to the file, and saving it over the original file.</p>
+
+<p>Now when you make changes to the source file in the Style Editor the CSS is regenerated and you can see the changes right away.</p>
+
+<h2 id="Atalhos_de_teclado">Atalhos de teclado</h2>
+
+<h3 id="Source_editor_shortcuts">Source editor shortcuts</h3>
+
+<p>{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "source-editor") }}</p>
+
+<p>{{ languages( { "ja": "ja/Tools/Style_Editor"} ) }}</p>