thuliteio / doks

Everything you need to build a stellar documentation website. Fast, accessible, and easy to use.
https://getdoks.org
MIT License
2.11k stars 361 forks source link

alert-link css missing #374

Closed james-d-elliott closed 3 years ago

james-d-elliott commented 3 years ago

Description

Note: I'm not particularly skilled at front-end, so I'm potentially just making a stupid mistake since I don't see any other reports.

Currently it seems like the doks and doks-child-theme are not generating the alert-link css using npm run build. I tested the getdoks.org repo as well, and the results differ on the same machine. The result is links in light mode appear without an underline and with the same color as the background, and appear as normal text in dark mode.

This doesn't affect npm run start, it's only when the page is published to netlify or github pages that you see the issue. i.e. because of some difference between npm run build. The confusing thing is this doesn't affect the getdoks.org repo.

Steps to reproduce

  1. git clone git@github.com:h-enk/doks.git && cd doks
  2. Edit config/_default/params.toml and change alert to true
  3. npm install
  4. npm run build
  5. cat public/*.css | grep alert-link
  6. Repeat for git@github.com:h-enk/getdoks.org.git

Expected result

CSS should be the same between the dev environment and the live environment (except minified).

Actual result

CSS differs for this one particular area.

Environment

@hyas/doks@0.3.1 precheck npm version

{ '@hyas/doks': '0.3.1', npm: '7.7.6', node: '15.14.0', v8: '8.6.395.17-node.28', uv: '1.41.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.17.1', modules: '88', nghttp2: '1.42.0', napi: '8', llhttp: '2.1.3', openssl: '1.1.1k+quic', cldr: '38.1', icu: '68.2', tz: '2020d', unicode: '13.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' }

@hyas/doks@0.3.1 check exec-bin bin/hugo/hugo version

hugo v0.84.0-2C4689F7B+extended linux/amd64 BuildDate=2021-06-18T17:14:27Z VendorInfo=gohugoio

h-enk commented 3 years ago

@james-d-elliott, thanks for pointing this out! The 'alert-link' class was not picked up by PurgeCSS. I've now added it to the safelist in ./config/postcss.config.js.

90065dbf10c1a317af2dbfd8ec9b28d7db794d37

james-d-elliott commented 3 years ago

Thanks for the quick fix. Knew it'd be an easy one just couldn't figure it out from the differences in code.. interestingly getdoks.org doesn't have this alteration. Potentially it's due to some form of direct/indirect usage though no clue how PurgeCSS works.

HarborZeng commented 2 years ago

so this is why my custom css works in local but not in server...