TACC / Core-Styles

CSS dist files, source code, and build process for TACC-branded projects.
https://tacc.utexas.edu/static/ui
0 stars 0 forks source link

How Best to Provide Compiled Stylesheets #342

Open wesleyboar opened 4 months ago

wesleyboar commented 4 months ago

Goal

Design a solution to offer compiled and minified stylesheets without committing dist/ to the repository.

Background

The repository has a /dist folder. This folder provides compilation of stylesheets using non-native CSS (that is made native via postcss) and minifies the CSS (for smaller file size).

To build and commit /dist is:

Expectations

  1. The NPM Package^1 offers compiled files. Why? So clients can use non-native CSS, from releases, on software that does not compile CSS.
  2. The NPM Package^1 offers minification. Why? So users download smaller files.
  3. The repository will not save compiled stylesheets from source that uses all native syntax. Why? Because a compiled, minified version of all native CSS is redundant.
  4. Client can use, before a release, compiled stylesheet from source that uses non-native syntax. Why? So clients can use non-native CSS, from a commit-ish (e.g. commit, branches, tag, pre-releases), on software that does not compile CSS.
  5. (Maybe) Paths to compiled files are less different from paths to source files. Currently src/lib/_imports/components/c-some-thing.css is compiled to dist/components/c-some-thing.css.

References

wesleyboar commented 4 months ago

Ideas

A. Only Commit /dist During Release, and As Needed

  1. Retain existing committed files.
  2. Do not commit dist files by default (use .gitignore).
  3. Yet…
    • Do commit dist files on release. (Publish step runs a script that runs git add dist.)
    • Do commit dist files when client must test compiled CSS for incomplete feature. (Dev manually runs git add dist/components/c-some-thing.css.)