Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Add css grid autoprefixing (#503)
Browse files Browse the repository at this point in the history
* update fixture to use grid

* update expected css built from fixture

* Add grid autoprefixing

* ignore optional deps on travis
  • Loading branch information
JakeChampion authored Jan 22, 2018
1 parent 205a042 commit 431cb77
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ node_js:
- '8'
script:
- npm i -g npm@^5
- npm i
- npm i --no-optional
- npm dedupe
- make ci
cache:
directories:
Expand Down
3 changes: 2 additions & 1 deletion lib/tasks/build-sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ module.exports = function buildSass(config) {
browsers: config.autoprefixerBrowsers || ['> 1%', 'last 2 versions', 'ie > 6', 'ff ESR', 'bb >= 7', 'safari >= 8'],
cascade: config.autoprefixerCascade || false,
flexbox: 'no-2009',
remove: config.autoprefixerRemove === undefined ? true : config.autoprefixerRemove
remove: config.autoprefixerRemove === undefined ? true : config.autoprefixerRemove,
grid: true
};

return readFile(code, 'utf-8')
Expand Down
27 changes: 25 additions & 2 deletions test/integration/build/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,34 @@ describe('obt build', function () {
})
.then(() => {
proclaim.deepEqual(fs.readFileSync('build/main.css', 'utf-8'), `.o-test {
font-size: 18px; }
font-size: 18px;
display: -ms-grid;
display: grid;
-ms-grid-columns: 1fr 1fr;
grid-template-columns: 1fr 1fr;
-ms-grid-rows: 1fr;
grid-template-rows: 1fr; }
.o-test--error {
background-color: red;
color: white; }
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNDO0VBQ0MsZ0JBQWUsRUFNZjtFQUpBO0lBQ0Msc0JBQXFCO0lBQ3JCLGFBQVksRUFDWiIsImZpbGUiOiJtYWluLmNzcyJ9 */`);
.test__content {
-ms-grid-column-span: 2;
-ms-grid-column: 1;
grid-column: 1 / span 2;
-ms-grid-row: 1;
grid-row: 1;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-align-self: center;
-ms-flex-item-align: center;
-ms-grid-row-align: center;
align-self: center; }
.test__visual {
-ms-grid-row: 1;
grid-row: 1; }
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNDO0VBQ0MsZ0JBQWU7RUFDZixrQkFBYTtFQUFiLGNBQWE7RUFDYiwwQkFBOEI7RUFBOUIsK0JBQThCO0VBQzlCLG1CQUF1QjtFQUF2Qix3QkFBdUIsRUFLdkI7RUFKQTtJQUNDLHNCQUFxQjtJQUNyQixhQUFZLEVBQ1o7O0FBRUY7RUFDQyx3QkFBdUI7RUFBdkIsbUJBQXVCO0VBQXZCLHdCQUF1QjtFQUN2QixnQkFBVztFQUFYLFlBQVc7RUFDWCwrQkFBc0I7RUFBdEIsdUJBQXNCO0VBQ3RCLDJCQUFrQjtFQUFsQiw0QkFBa0I7RUFBbEIsMkJBQWtCO0VBQWxCLG1CQUFrQixFQUNsQjs7QUFDRDtFQUNDLGdCQUFXO0VBQVgsWUFBVyxFQUNYIiwiZmlsZSI6Im1haW4uY3NzIn0= */`);
});
});
});
Expand Down
13 changes: 12 additions & 1 deletion test/integration/build/fixtures/sass/main.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
@mixin oTestComponent() {
.o-test {
font-size: 18px;

display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
&--error {
background-color: red;
color: white;
}
}
.test__content {
grid-column: 1 / span 2;
grid-row: 1;
box-sizing: border-box;
align-self: center;
}
.test__visual {
grid-row: 1;
}
}

@include oTestComponent;

0 comments on commit 431cb77

Please sign in to comment.