Skip to content

Commit

Permalink
Demonstrate import path rewriting in example app
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Rawlings committed May 10, 2017
1 parent 6582c4e commit fa099b3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
5 changes: 2 additions & 3 deletions example/app/assets/styles/mixins.scss
@@ -1,3 +1,2 @@
@mixin center-text {
text-align: center;
}
@import 'mixins/centerText';
@import 'mixins/fullWidth';
3 changes: 3 additions & 0 deletions example/app/assets/styles/mixins/centerText.scss
@@ -0,0 +1,3 @@
@mixin center-text {
text-align: center;
}
3 changes: 3 additions & 0 deletions example/app/assets/styles/mixins/fullWidth.scss
@@ -0,0 +1,3 @@
@mixin full-width {
width: 100%;
}
2 changes: 1 addition & 1 deletion example/app/components/Hero/Hero.scss
@@ -1,7 +1,7 @@
.hero {
@include center-text;
@include full-width;
margin-bottom: 50px;
width: 100%;
height: 70vh;
background-color: $background-color;
color: $text-color;
Expand Down
2 changes: 1 addition & 1 deletion example/app/layout/Layout.scss
Expand Up @@ -4,7 +4,7 @@
}

.layout {
@include full-width;
display: block;
position: relative;
width: 100%;
}
5 changes: 4 additions & 1 deletion example/webpack.config.js
Expand Up @@ -47,7 +47,10 @@ module.exports = {
{
loader: 'sass-resources-loader',
options: {
resources: './app/assets/styles/**/*.scss',
resources: [
'./app/assets/styles/variables/*.scss',
'./app/assets/styles/mixins.scss',
],
},
},
],
Expand Down
7 changes: 6 additions & 1 deletion example/webpack.prod.config.js
Expand Up @@ -43,7 +43,12 @@ module.exports = {
'sass-loader',
{
loader: 'sass-resources-loader',
query: { resources: './app/assets/styles/**/*.scss' },
query: {
resources: [
'./app/assets/styles/variables/*.scss',
'./app/assets/styles/mixins.scss',
],
},
},
],
}),
Expand Down

0 comments on commit fa099b3

Please sign in to comment.