A sample site for testing w3 CSS validator against @thulite/doks-core
Some SCSS variables are not being replaced during libsass processing and are ending up as text in the CSS.
- Set up a test site
npm create thulite@latest thulite-css-validation-test -- --template doks
cd thulite-css-validation-test
npm install
- Start the hugo server:
npm run dev
- Browse to the CSS
- In your browser 'view-source'
- Click on the 'main.<hash>.css' link.
- OR use your browser developer tools and set to NOT display source.
- Search for $body-bg-dark.
- Observe it is present in the 'live' CSS.
- Cancel the server (Ctrl-C)
- Build the site:
hugo --gc
- Obtain and install W3 Nu Validator
- Download the latest release from
https://github.com/validator/validator/releases
- E.g.
wget https://github.com/validator/validator/releases/download/latest/vnu.jar
- E.g.
- Ensure you have a recent-ish Java JRE (I use openjdk-17-jre from Debian 12 'Bookworm')
- Download the latest release from
https://github.com/validator/validator/releases
- Use the Validator and observe the results
- Execute
java -jar ./vnu.jar --skip-non-css $(find public -name '*.css' | tr $'\n' ' ')
- Execute
- Go to the file and line containing an error like
error: CSS: “color”: Parse Error.
- In our case, these are usually unprocessed variables.