Skip to content

Commit 6f10a1e

Browse files
MaxLardenoismdojulien-deramond
authored
Docs: add Sass deprecations notices (#41283)
Co-authored-by: Mark Otto <[email protected]> Co-authored-by: Julien Déramond <[email protected]>
1 parent 33bb991 commit 6f10a1e

File tree

5 files changed

+42
-2
lines changed

5 files changed

+42
-2
lines changed

.cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"roboto",
8888
"RTLCSS",
8989
"ruleset",
90+
"sassrc",
9091
"screenreaders",
9192
"scrollbars",
9293
"scrollspy",

site/content/docs/5.3/customize/sass.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ toc: true
88

99
Utilize our source Sass files to take advantage of variables, maps, mixins, and more.
1010

11+
{{< callout warning >}}
12+
Sass deprecation warnings are shown when compiling source Sass files with the latest versions of Dart Sass. This does not prevent compilation or usage of Bootstrap. We're [working on a long-term fix]({{< param repo >}}/issues/40962), but in the meantime these deprecation notices can be ignored.
13+
{{< /callout >}}
1114
## File structure
1215

1316
Whenever possible, avoid modifying Bootstrap's core files. For Sass, that means creating your own stylesheet that imports Bootstrap so you can modify and extend it. Assuming you're using a package manager like npm, you'll have a file structure that looks like this:

site/content/docs/5.3/getting-started/parcel.md

+8
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ Importing Bootstrap into Parcel requires two imports, one into our `styles.scss`
132132

133133
*You can also import our stylesheets individually if you want. [Read our Sass import docs]({{< docsref "/customize/sass#importing" >}}) for details.*
134134

135+
**Optional:** You may see Sass deprecation warnings with the latest versions of Dart Sass. These can silenced by adding the following configuration in a `.sassrc.js` file in the root folder with the following:
136+
137+
```js
138+
module.exports = {
139+
silenceDeprecations: ['import', 'mixed-decls', 'color-functions', 'global-builtin']
140+
}
141+
```
142+
135143
2. **Import Bootstrap's JS.** Add the following to `src/js/main.js` to import all of Bootstrap's JS. Popper will be imported automatically through Bootstrap.
136144

137145
<!-- eslint-skip -->

site/content/docs/5.3/getting-started/vite.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,25 @@ With dependencies installed and our project folder ready for us to start coding,
9494
},
9595
server: {
9696
port: 8080
97-
}
97+
},
98+
// Optional: Silence Sass deprecation warnings. See note below.
99+
css: {
100+
preprocessorOptions: {
101+
scss: {
102+
silenceDeprecations: [
103+
'import',
104+
'mixed-decls',
105+
'color-functions',
106+
'global-builtin',
107+
],
108+
},
109+
},
110+
},
98111
}
99112
```
100113

114+
**Note:** Sass deprecation warnings are shown when compiling source Sass files with the latest versions of Dart Sass. This does not prevent compilation or usage of Bootstrap. We're [working on a long-term fix]({{< param repo >}}/issues/40962), but in the meantime these deprecation notices can be ignored.
115+
101116
2. **Next we fill in `src/index.html`.** This is the HTML page Vite will load in the browser to utilize the bundled CSS and JS we'll add to it in later steps.
102117

103118
```html

site/content/docs/5.3/getting-started/webpack.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,18 @@ Importing Bootstrap into Webpack requires the loaders we installed in the first
203203
},
204204
{
205205
// Loads a SASS/SCSS file and compiles it to CSS
206-
loader: 'sass-loader'
206+
loader: 'sass-loader',
207+
options: {
208+
sassOptions: {
209+
// Optional: Silence Sass deprecation warnings. See note below.
210+
silenceDeprecations: [
211+
'mixed-decls',
212+
'color-functions',
213+
'global-builtin',
214+
'import'
215+
]
216+
}
217+
}
207218
}
208219
]
209220
}
@@ -214,6 +225,8 @@ Importing Bootstrap into Webpack requires the loaders we installed in the first
214225

215226
Here's a recap of why we need all these loaders. `style-loader` injects the CSS into a `<style>` element in the `<head>` of the HTML page, `css-loader` helps with using `@import` and `url()`, `postcss-loader` is required for Autoprefixer, and `sass-loader` allows us to use Sass.
216227

228+
**Note:** Sass deprecation warnings are shown when compiling source Sass files with the latest versions of Dart Sass. This does not prevent compilation or usage of Bootstrap. We're [working on a long-term fix]({{< param repo >}}/issues/40962), but in the meantime these deprecation notices can be ignored.
229+
217230
2. **Now, let's import Bootstrap's CSS.** Add the following to `src/scss/styles.scss` to import all of Bootstrap's source Sass.
218231

219232
```scss

0 commit comments

Comments
 (0)