How to include a custom SCSS theme? (Add standalone stylesheet files to packages)
See original GitHub issueType of Issue
[ ] Bug Report
[x] Feature Request
[x] Documentation Request/Question
Description
I have an existing component library that includes a SCSS theme, similar to what Angular Material does. I’m currently using Gulp+Rollup to build that library, and I’ve basically copied what Angular Material does in order to get my theme to be bundled and distributed inside the package. I’m using the scss-bundle package to bundle/generate a single theming file, and copying the result to the dist folder.
Is there any way to accomplish that using ng-packagr? I first tried adding a secondary module, but since there is no JS/TS code involved in the theming, it’s not going to pick it up.
How To Reproduce
Expected Behaviour
Version Information
ng-packagr: v1.4.1
@angular: v4.4.6
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Sass · Bootstrap v5.1
In your custom.scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you...
Read more >The complete guide to customizing a Tailwind CSS theme
The complete tutorial on creating a custom Tailwind CSS theme, including installing Node.js and setting up the PostCSS build process.
Read more >Customization - Material for MkDocs - GitHub Pages
The easiest way is by creating a new style sheet file in the docs directory: ... or add some custom logic to your...
Read more >CSS Themes - JavaScript Scheduler - DayPilot Documentation
Include the theme CSS in the page (usually it will be a standalone CSS file). Set the theme to be used using the...
Read more >How to add Tailwind CSS to HTML? - Themesberg
Learn how to quickly add Tailwind CSS to your HTML using CDN or learn the advanced method of using a package manager and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to get it working very simply using scss-bundle. Here’s what I did:
yarn add -D scss-bundle
Voila, running
yarn build
will create the package and then spit out the bundled scss into the dist directory alongside the package.I dislike these solutions involving a post build step. None of this can be applied when using
ng build --watch=true
Developer workflow with HMR goodness is lost. We need a built-in way to copy scss to dist without the post build hack.