I would like to edit SCSS files in Eclipse, preferably with syntax highlighting for .scss
files.
I found these resources valuable:
How can do I integrate SCSS development within the Eclipse editor?
Or, more generally, how do I integrate a CSS pre-processor into Eclipse?
Eclipse Web Developer ToolsIncludes the HTML, CSS, and JSON Editors, and JavaScript Development Tools from the Eclipse Web Tools Platform project, aimed at supporting client-side web development and node. js applications.
Eclipse and declarative stylingCSS selectors used in Eclipse are identifiers, which relate to widgets or other elements, for example predefined pseudo classes. Non-standard properties are prefixed with either swt- or eclipse- . The following example shows a CSS file which defines a styling for an Eclipse application.
I just figured out how to do this in Eclipse. I admit that this solution does not have 100% SASS support, the colors get a little funky when using nested css, but it's waaaaay better than looking at plain text and you don't need to install a separate editor.
You need to associate the .scss file type with the native Eclipse CSS Editor in Eclipse[Part 1]. After you do that, you need to add the .scss file type to the native CSS Editor as well so the CSS Editor will be able to open it [Part 2]. Here are the steps for eclipse (I'm running Eclipse Java EE IDE for Web Developers, Indigo):
Go to Window > Preferences
Drill down to General > Editors > File Associations
In File Associations pane, click the 'Add..." button on the top right.
For File Type:
, enter *.scss
and then click OK
.
Find the *.scss
entry in the File Associations
list and select it.
After selecting *.scss
, on the bottom pane Associated editors:
, click the Add...
button.
Make sure Internal editors
is selected on the top, then find and select CSS Editor
and then click OK
.
This associated the file type .scss with eclipses native CSS Editor. Now we have to configure the native CSS Editor to support .scss files. To do this, follow this steps:
Go to Window > Preferences
Drill down to General > Content Types
In the Content Types pane, expand Text
, then select CSS
After CSS
is selected, on the bottom File associations:
pane, click the Add...
button.
For Content type:
, enter *.scss
and then click OK
.
Click OK
to close out the Preferences window.
All done. All you need to do now is close any .scss files that you have open then re-open them and wha-la, css colors in Eclipse for .scss files!
Note: If the css colours do not appear you may have to do the following: Right click the .scss file > Open With > CSS Editor
.
Hope this helps.
Aptana Studio provides syntax coloring support for SASS/SCSS and it’s possible to install Aptana as Plugin into Eclipse. See the following quote from the Aptana sownload site:
Installing via Eclipse
Please copy the following Update Site URL to your clipboard and then follow the steps listed below to add this URL to your Available Software Sites list. Attempting to access this URL using your web browser will return an Access Denied error.
http://download.aptana.com/studio3/plugin/install
- From the Help menu, select »Install New Software …« to open the Install New Software dialog.
- Paste the URL for the update site into the Work With text box, and hit the Enter (or Return) key.
- In the populated table below, check the box next to the name of the plug-in, and then click the Next button.
- Click the Next button to go to the license page.
- Choose the option to accept the terms of the license agreement, and click the Finish button.
- You may need to restart Eclipse to continue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With