ritwickdey / vscode-live-sass-compiler

Compile Sass or Scss file to CSS at realtime with live browser reload feature.
https://ritwickdey.github.io/vscode-live-sass-compiler/
MIT License
660 stars 168 forks source link

Not prefixing CSS property #561

Closed KunalTanwar closed 2 years ago

KunalTanwar commented 2 years ago

Extension setting : "liveSassCompile.settings.autoprefix": ["> 1%", "last 2 versions"]

CSS color-adjust: exact

GETTING ~color-adjust: exact~

EXPECTED OUTPUT -webkit-print-color-adjust: exact

glenn2223 commented 2 years ago

This extension is using autoprefixer data from 2018, you will find new CSS properties will not compile with the expected result. My extension uses a newer version so it should work as expected - according to the data provided by caniuse.


This extension is no longer maintained - see #486, this will show you that I have a fork that I'm actively maintaining.

After reading it, please close this issue so my own can stay top of the list. Thanks

KunalTanwar commented 2 years ago

Okay! lets se when will this solve!!

KunalTanwar commented 2 years ago

Does the same settings will work with your variant/version too??

glenn2223 commented 2 years ago

You can see a migration guide here. Almost all the settings have stayed the same - there's the below snippet, for reference

- Some settings have been changed
  - `formats[].format` only accepts `compressed` or `expanded`
  - `autoprefix`:
    - The default is `defaults`
    - `null` is no longer accepted, use `false` instead
    - When `true` we will find a `.browserslistrc` file or `browserslist` in your `package.json`. No more duplicating settings!
  - `showOutputWindow` is now `showOutputWindowOn` and uses log values (`Debug`, `Error`, etc.). It's default log level is `Information` - at this level it will output the same information that the original extension does
- Some settings are new!
  - `savePathSegmentKeys` and `savePathReplaceSegmentsWith`: when used in combination you can choose to replace folder segments in the save path
  - `watchOnLaunch`: state whether you want to watch files upon launch
  - `compileOnWatch`: state if files should be compiled upon watching
  - `forceBaseDirectory`: state the base directory of all you SASS files. Aids in reducing wasted resources while searching for files
KunalTanwar commented 2 years ago

Thanks!! Will checkout.

glenn2223 commented 2 years ago

Hey @KunalTanwar, did you manage to sort the issue. I only ask because I was about to start testing the sample you provided over on my fork and you'd deleted the messages and re-opened this issue? As I was saying you may be trying to prefix CSS properties that just don't need to be anymore - however targeting specific browser versions can add these prefixes back in (for example IE 11).


As you can see from the below example my fork is outputting the expected result when I use the settings that follow

image showing that `-ms-grid-row` and `-webkit-print-color-adjust` have both been added to the CSS output - along with other various lines of CSS properties

Settings:

{
    ...
    "liveSassCompile.settings.autoprefix": [
        "defaults",
        "IE 10"
    ],
    ...
}

As I said previously, this extension isn't using the latest browser information from caniuse nor a recent autoprefixer release. I would recommend using my updated fork and opening a new issue if you come across any problems

KunalTanwar commented 2 years ago

Yeah! Thanks alot for your reply, I already got the solution after searching for hours and currently I am using PostSCSS library with autoprefixer. Also, I uninstalled the extension from ritwickdey and started using your extension.