A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.jetbrains.com/help/webstorm/style-sheets.html below:

Style Sheets | WebStorm Documentation

Style Sheets

With WebStorm, you can write style definitions in CSS as well as in various languages that compile into it, such as Sass, Less, SCSS, or Stylus.

You can also look up documentation for Style Sheets, create and move rulesets, introduce variables, and more.

Before you start

Make sure the CSS plugin is enabled in the settings. Press Ctrl+Alt+S to open settings and then select . Click the Installed tab. In the search field, type CSS. For more information about plugins, refer to Managing plugins.

Code completion

WebStorm provides code completion for properties, their values, selectors, variables, and mixins.

Complete Style Sheet classes

Completion for CSS, SCSS, Less, and Sass classes and ids is available in HTML files, in various types of templates (for example, in Angular or Vue.js), as well as in JSX code.

In HTML files, WebStorm first suggests classes and ids from the style tag and files linked with link tags. If no matching results are found, WebStorm also suggests symbols defined in all stylesheet files in the project. To see all classes and ids defined in the project straight away, before you start typing, press Ctrl+Space twice.

Complete Style Sheet classes from external libraries

With WebStorm, you can also get completion for class names from Twitter Bootstrap or other CSS libraries that are linked from a CDN in an HTML file without adding these libraries to your project dependencies.

  1. Open the HTML file with a CDN link to an external CSS library. WebStorm highlights the link.

  2. To enable completion for the library, press Alt+Enter on the link and select from the list. Alternatively, hover over the link and click Download library.

The library is added to the list of JavaScript libraries on the page. For more information, refer to Configuring a library added via a CDN link.

Complete Sass and SCSS selectors

WebStorm also provides completion for Sass and SCSS selectors - including nested selectors and selectors created with an ampersand (&).

Cloud Completion and Full Line completion in Style Sheets

WebStorm provides Cloud Completion and Full Line completion in CSS, Less, Sass/SCSS, and PostCSS code.

The Full Line code completion feature uses a locally run deep learning model to suggest entire lines of code.

Enable Full Line code completion in Style Sheets
  1. Press Ctrl+Alt+S to open settings and select Editor | General | Inline Completion.

  2. Select the Enable local Full Line completion suggestions checkbox and make sure the CSS-like checkbox is selected.

Cloud completion powered by AI Assistant can autocomplete single lines, blocks of code, and even entire functions in real time based on the project context.

Cloud Completion suggests syntactically acceptable solutions taking the context into account and runs various code inspections in advance to reject the variants that result in errors.

Enable Cloud Completion
  1. Install and enable the AI Assistant plugin.

  2. Press Ctrl+Alt+S to open settings and select Editor | General | Inline Completion.

  3. Select the Enable cloud completion suggestions checkbox and make sure the HTML checkbox is selected.

Search and navigation Documentation look-up

For properties and pseudo-elements, WebStorm can show you a summary from the corresponding MDN article. This summary is displayed in the Documentation popup which shows a brief description of the property and its values, as well as information about its compatibility with various browsers.

If the property is available in all versions of browsers, WebStorm does not show any information about its compatibility.

Otherwise, the Documentation popup also lists the browsers and their versions that support the property.

Note that compatibility is checked only for Chrome, Chrome Android, Safari, Safari iOS, Firefox, Internet Explorer, and Edge.

For selectors, WebStorm also shows their specificity.

View documentation for a property Open the MDN documentation in the browser Formatting

With WebStorm built-in formatter, you can reformat fragments of Style Sheet code as well as entire files and folders to meet the language-specific code style requirements. The formatter also wakes up automatically when you generate or refactor your code.

See Reformat and rearrange code for more details.

Alternatively, you can use the Prettier. For more information, refer to Prettier.

Refactoring
  1. In the editor, place the caret at the expression to convert into a variable and press Ctrl+Alt+V or select from the context menu or from the main menu.

  2. If more than one occurrence of the selected expression is found, select Replace this occurrence only or Replace all occurrences from the Multiple occurrences found list.

  3. For .scss, and .sass, select the global or local scope for the variable.

  4. In the field with red borders, accept the suggested variable name or specify a custom name. Press Enter when ready.

With WebStorm, you can create new rulesets from existing declarations in CSS, SCSS, Sass, or Less files and even move entire rulesets between files using refactoring and intention actions.

  1. Select the declarations to introduce. If you need only one declaration, just place the caret inside it.

  2. Press Alt+Enter and select Introduce ruleset from the list.

WebStorm creates a new ruleset with the same selector and moves the selected declarations to it. If the selection contains comments, nested selectors, and so on, they are also moved to the new ruleset.

Move rulesets to other files
  1. Place the caret anywhere in the ruleset to move and press F6.

  2. In the dialog that opens, specify the file to move the ruleset to. If the specified file does not exist, WebStorm will suggest creating it.

  3. By default, WebStorm automatically opens the file where the ruleset is moved. To change this behavior, clear the Open in editor checkbox.

Common refactorings, such as Copy, Move, or Rename, are also available.

Checking compatibility with browsers

Besides looking up in the documentation popup, you can check Style Sheet properties for compatibility with specific browsers on the fly. This inspection is based on the MDN Browser Compatibility Data and shows you a warning every time a property is not supported in one of the targeted browsers.

Turn on compatibility check
  1. In the Settings dialog (Ctrl+Alt+S) , go to .

  2. Expand the CSS node and select the Browser compatibility for properties. In the Options area, select the browsers you want to target and the minimum versions for them.

Changing color values

With WebStorm, you can easily change color values in Style Sheets without typing hexadecimal codes.

Choose colors
  1. Open the desired Style Sheet for editing.

  2. Type color:, and then press Ctrl+Space.

  3. Select the desired color value from the suggestion list or choose color... to pick a custom one.

Change colors
  1. Open the desired Style Sheet for editing, and locate the color property that you want to change.

  2. Click the color icon in the gutter.

    Alternatively, if the icons are not shown, press Alt+Enter and select Change color from the list. See To show color icons in the gutter below.

  3. In the Choose color dialog that opens, pick the desired new color and click Choose.

Preview the code of colors Show color icons in the gutter

By default, WebStorm displays color icons in the gutter. If they are hidden, you can return them at any time.

  1. In the Settings dialog (Ctrl+Alt+S) , go to . The Gutter Icons page opens.

  2. In the Common area, select the Color preview checkbox.

Viewing the styles applied to a tag

In HTML and XHTML files, WebStorm can show you all the styles applied to an arbitrary tag.

Configuring syntax highlighting

You can configure CSS-aware syntax highlighting according to your preferences and habits.

  1. In the Settings dialog (Ctrl+Alt+S) , go to .

  2. Select the color scheme, accept the highlighting settings inherited from the defaults or customize them as described in Colors and fonts.

Last modified: 03 April 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4