You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
In order to demonstrate how webpack bundles our Sass, you’ll need an `index.html`. This HTML file needs to include CSS. The CSS is generated by sass-loader, which compiles Sass files into CSS. The CSS is extracted into a `.css` file by extract-loader. Create this simple “hello world” `index.html`:
We need to tell our `app.scss` to import the Sass files for `@material/button`. We can also use Sass mixins to customize the button. Replace your “hello world” version of `app.scss` with this code:
167
173
168
174
```scss
169
-
@import"@material/button/mdc-button";
175
+
@use'@material/button/mdc-button';
176
+
@use'@material/button';
170
177
171
178
.foo-button {
172
-
@includemdc-button-ink-color(teal);
173
-
@includemdc-states(teal);
179
+
@includebutton.container-fill-color(darksalmon);
174
180
}
175
181
```
176
182
@@ -180,9 +186,11 @@ We also need to configure sass-loader to understand the `@material` imports used
180
186
{
181
187
loader:'sass-loader',
182
188
options: {
189
+
// Prefer Dart Sass
190
+
implementation:require('sass'),
183
191
sassOptions: {
184
192
includePaths: ['./node_modules']
185
-
}
193
+
},
186
194
}
187
195
}
188
196
```
@@ -226,7 +234,9 @@ Then add `postcss-loader`, using `autoprefixer` as a plugin:
0 commit comments