onelson / estuary

33 stars 8 forks source link

Build tree-shaken styles using tailwindcss-cli. #21

Closed onelson closed 3 years ago

onelson commented 3 years ago

Adds an npm package to track the package versions we need for building styles. New tailwind css and config files are now used to produce a "dist" stylesheet, which scans the rust/template sources for class names to include in the output.

The stylesheet is exposed to the front-facting site via a dedicated handler which uses include_str!() to bake the styles into the binary.

If we end up adding more static files, we may want to generalize this to support mutliple files from a single handler. Potentially we could use https://crates.io/crates/include_dir to capture js/fonts/styles produced by our npm project.

A danger with this approach is accidentally releasing versions of estuary with outdated dist styles. We'll have to consider how to avoid this.

codecov[bot] commented 3 years ago

Codecov Report

Merging #21 (a70f339) into main (46d4e64) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files           8        8           
  Lines         772      772           
=======================================
  Hits          742      742           
  Misses         30       30           
Impacted Files Coverage Δ
src/handlers.rs 100.00% <ø> (ø)
src/handlers/frontend.rs 96.85% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 46d4e64...a70f339. Read the comment docs.