A
A
Alex2020-05-26 09:32:22
css
Alex, 2020-05-26 09:32:22

How to set up environment in phpstorm to write CSS with new features ( & and @nested, CSS Custom Properties), selector nesting?

I wanted to write in pure css with new features, now they are transitioning or planning a transition on projects, I decided to practice. Installed postcss, installed plugins in postcss.config.js In postcss-preset-env, almost everything is already there, it should work, var (--foo) works, there are variables, but there is no nesting. I want to invest, what should I do? Are there any examples that you would recommend?

Installed plugins:

module.exports = {
  plugins: [
    require('postcss-preset-env')({
      features: {
        'nesting-rules': true,
        'color-mod-function': { unresolved: 'warn' }
      }
    }),
    require('postcss-animation'),
    require('postcss-fixes')({
      preset: 'recommended'
    }),
    require('cssnano')({
      preset: [
        'default', {
          discardComments: {
            removeAll: true
          }
        }
      ]
    }),
  ]
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-05-26
@orlovec

Found the answer: I
just remembered that I should look into the collection of plugins for phpstorm.
You need to install
AND configure phpstorm: The IDE now recognizes .pcss files. You can also enable PostCSS support for your .css files in Preferences | Languages ​​& Frameworks | style sheets | Dialects.
5eccbce3c592a759882418.png
As a result, it was / became:
5eccbd0dbff10735450507.png
5eccbd561fef2427931247.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question