To establish a hard wrap for CSS files in JetBrains WebStorm, follow these steps:
- Open the settings dialogue by navigating to File > Settings (Windows, Linux) or WebStorm > Preferences (macOS).
- In the left-hand pane of the settings dialogue, navigate to Editor > Code Style.
- Click on the "CSS" tab.
- In the "CSS" tab, scroll down to the "Wrapping and Braces" section.
- Check the box next to "Wrap when typing reaches right margin."
- In the adjacent text field, enter the maximum line length at which you want the hard wrap to occur (this is typically 80 characters).
- Click "Apply" and then "OK" to save your changes.
From now on, when you type in a CSS file in WebStorm and reach the right margin, the editor will automatically create a new line and split your code at the appropriate point to adhere to the hard wrap you've established.