Closed melaniejaane closed 1 hour ago
Can you show the full error message?
Unknown word means syntax error, like missed ;
or }
.
It’s having issues with double slash comments formatting:
CssSyntaxError: <css input>:146:46: Unknown word
144 |
145 |
> 146 | //max-height: calc(100% - 100px)!important; //Adjust 40px to your desired maximum margin
| ^
147 | }
148 |
In CSS you can use only /**/
for comments. //
is not supported.
If it is SCSS, you can use postcss-scss
parser to parse it. Just replace parser in PostCSS config.
Is there an online version of postcss-scss that doesn’t require download? Similar to Autoprefixer CSS online. Thanks
Sorry, no. I recommend convert comments to CSS format /**/
since they are safe.
If I want to try postcss-scss how can I install and set it up on a Mac?
The steps just say “install npm --save install postcss postcss-scss“ but it doesn’t specify where or how to do that.
Sorry I’m pretty new to GitHub and haven’t set something like this up before.
You need to install postcss-cli
and create postcss.config.js
like:
module.exports = {
parser: 'postcss-scss',
plugins: {
'autoprefixer': {}
}
}
I’m so sorry, clearly dense, but how do you actually do this, or where? None of these things have download links so I assume I need to past the code somewhere to install? What sort of applications do I need to use for this? Sorry and thank you again!
I’m so sorry, clearly dense, but how do you actually do this, or where?
I use Autoprefixer and PostCSS built-in in bundler like Vite which I use to devel websites (it is CLI tool which I install by npm
and run by running npm build
in terminal).
It is the best way to use Autoprefixer since everything will work auto-magically (you change CSS file and browsers automatically hot-reload it). But it needs time to get used to.
I’m just using the browser version, is there a way to force it to ignore CssSyntaxError: Unknown Words and just add vendor prefixes where it knows it can?