File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ # How do I migrate from a CDN stylesheet to an NPM package?
2
+ Often, referencing a stylesheet from a CDN is all that's needed to add new styles but you can use an NPM package instead.
3
+ ---
4
+
5
+ #### 1. Remove the CDN Reference
6
+ Remove the CDN reference from the index template in ` src/Client/index.html ` :
7
+ ``` html
8
+ <
link rel =
" stylesheet" href =
" https://cdn.jsdelivr.net/npm/[email protected] /css/bulma.min.css" >
9
+ ```
10
+
11
+ #### 2. Add the NPM Package
12
+ Add styles from NPM. [ How do I add an NPM package to the client?] ( ../../package-management/add-npm-package-to-client )
13
+ In this example we will add the [ Bulma NPM package] ( https://www.npmjs.com/package/bulma ) .
14
+
15
+ #### 3. Add a reference to your stylesheet
16
+ 1 . Add a stylesheet to your project using [ this recipe] ( ../add-style ) . Add a scss file instead of a css file.
17
+ 1 . Add the following lines to your scss file:
18
+ ``` scss
19
+ // Set variables to affect Bulma styles
20
+ $body-color : #c6538c ;
21
+ @import ' bulma/bulma.sass' ;
22
+ ```
Original file line number Diff line number Diff line change 76
76
- Add daisyUI support : " recipes/ui/add-daisyui.md"
77
77
- Add Feliz support : " recipes/ui/add-feliz.md"
78
78
- Add FontAwesome support : " recipes/ui/add-fontawesome.md"
79
+ - Migrate from a CDN stylesheet to an NPM package : " recipes/ui/cdn-to-npm.md"
79
80
- Storage :
80
81
- Quickly add a database : " recipes/storage/use-litedb.md"
81
82
- JavaScript :
You can’t perform that action at this time.
0 commit comments