How to enable CSS editing in Intellij
Asked Answered
C

9

11

I just switched to IntelliJ IDEA because I thought it would be great for developing JavaFX application.

I must be doing something wrong because when I am editing a CSS file, there is no code-completion. When I am trying to create a new CSS file there is no option for CSS files.

I am using the community version of IntelliJ.

I have looked very long for an answer, and it hurts that I have to ask here! I hope someone can help me.

Contemporaneous answered 1/9, 2015 at 18:28 Comment(0)
T
12

CSS editor is not supported for community edition, as it said at the language support part of IntelliJ IDEA Editions Comparison

enter image description here

Typography answered 1/9, 2015 at 19:1 Comment(0)
N
2

You can get help from community edition plugins page. For CSS editor, SmarterEditor and Shifter plugins may be helpful.

Nez answered 10/9, 2015 at 7:14 Comment(0)
S
1

The short answer is, IntelliJ Community Edition doesn't support CSS. But a workaround would be to manually attach the CSS to the scene(Or what ever element you want). Here's how to do it.

  • Don't go to the "src" and try to add a stylesheet there. Cause it is not there.

  • On the menu bar, Click on Files and create a new File. Make sure you name the file with .css extension (Ex: "newStyleSheet.css")

  • Edit the Style sheet as you would in JavaFx with CSS standards. (Ex: Changing the background colour of the scene)

    .root { -fx-background-color: #383838; }

  • Then attach the stylesheet to the element (in this case the "scene") from application code

    scene.getStylesheets().add("newStyle.css");

Run the application and you should see that the default Stylesheet(STYLESHEET_MODENA) has been changed with your new one.

Sardinian answered 25/3, 2021 at 5:13 Comment(0)
W
1

I've created WebCalm plugin that adds JavaScript and CSS support. It's free and open-source.

Womack answered 2/7, 2024 at 9:28 Comment(0)
C
0

Yes, the CSS editor is not supported for the community version of Intellij , in my case adding plugins did not work but something that helped me was the answer :-

You just need to create a new "file" rather than a directory, package or Java class and save the file with the .css extension.

that I got from here Need IntelliJ Ultimate Edition to run CSS?

Cist answered 16/4, 2019 at 8:7 Comment(1)
Yeap. This is the method that I'm using with the IntelliJ Community edition and it works like a charm.Sardinian
O
0

The short answer is no, at least at the moment. The best solution i for me so far is to open the resources folder in Atom editor and do all UI work there. It's handy because you also run atom live server, and not have to restart the application. Also Preview HTML is another very useful plugin.

Overelaborate answered 9/6, 2019 at 20:6 Comment(0)
S
0

you can do one thing that just make use of style tag in the html and inside that use all the css that you want to use

Squalid answered 14/5, 2020 at 18:0 Comment(0)
I
0

CSS, Sass, SCSS, Less, Stylus is checked ?overhere

Idyllist answered 21/2, 2022 at 0:11 Comment(2)
Please be more specific on answering.Rimmer
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Norbertonorbie
E
0

A potential work around to the lack of CSS editor in the community edition is to use another editor at the same time, say VS Code and get some of the missing functionality through a CSS plugin there.

Then when you edit the file in VS Code and save, it will propogate to Intellij.

Hope this helps some people.

Exhaustive answered 4/7, 2022 at 11:29 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.