Skip to content

Including css files #406

Answered by jaredcwhite
sbaildon asked this question in General
Jul 15, 2020 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

@sbaildon You'd still need to import the CSS file in an "index" file somewhere as part of your Webpacker pipeline. The location of the file doesn't automatically include it in the Webpack bundle. Also it wouldn't be scoped in the way you think — that example would make all div tags everywhere red. You can scope by CSS class names, data attributes, or using custom elements/web components (my personal favorite). Happy to supply reference links if you're curious.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@joelhawksley
Comment options

@jaredcwhite
Comment options

@sbaildon
Comment options

Answer selected by sbaildon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants