Skip to content

bessey/rails-css-component-techniques

Repository files navigation

Rails View Component based CSS encapsulation

Demonstrates a technique to automatically encapsulate View Component sidecar CSS. When writing sidecar css simply use the ::component psuedo-element selector to reference the component under development, and a class will be generated and your component will be wrapped in it.

See the feature's PR to find the interesting bits from the Rails cruft.

If you don't want to download and run yourself, here's the relevant results:

Rendered

Rendered output

CSS Output

CSS output

HTML Output

HTML output

About

Examples of ways to encapsulate Rails View Component CSS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published