Skip to content

Commit 33dd4db

Browse files
committed
refactor: replace bourbon with native CSS equivalents
Remove bourbon dependency entirely. Replace its features: - rem() -> native CSS rem units (all target platforms support them) - triangle() mixin -> CSS border-based triangle in select.scss - placeholder() mixin -> native ::placeholder pseudo-element - $golden variable -> inline golden ratio constant (1.618) Remove bourbon from gulpfile.js include paths. Update autoprefixer option from deprecated 'browsers' to 'overrideBrowserslist'.
1 parent 99b09c7 commit 33dd4db

10 files changed

Lines changed: 18 additions & 32 deletions

File tree

gulpfile.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ var insert = require('gulp-insert');
1717
var tsify = require('tsify');
1818
var clayPackage = require('./package.json');
1919

20-
var sassIncludePaths = [].concat(
21-
require('bourbon').includePaths,
22-
'src/styles'
23-
);
20+
var sassIncludePaths = ['src/styles'];
2421

2522
var autoprefixerOptions = {
26-
browsers: ['Android 4', 'iOS 8'],
23+
overrideBrowserslist: ['Android 4', 'iOS 8'],
2724
cascade: false
2825
};
2926

package-lock.json

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"@types/mocha": "10.0.10",
5858
"@types/sinon": "21.0.1",
5959
"autoprefixer": "^10.4.23",
60-
"bourbon": "^4.2.6",
6160
"browserify": "^13.0.0",
6261
"browserify-istanbul": "^3.0.1",
6362
"chai": "^3.4.1",

src/styles/clay/_base.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import "bourbon";
21
@import "clay";
32

43
html, body {
@@ -198,4 +197,3 @@ label {
198197
width:100%;
199198
border-collapse: collapse;
200199
}
201-

src/styles/clay/_vars.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
@import "bourbon";
2-
3-
// Bourbon settings
1+
// Base settings
42
$em-base: 17px;
53

64
// custom vars
75
$base-line-height: 1.4;
8-
$base-height: rem($base-line-height * $em-base);
6+
$base-height: $base-line-height * $em-base;
97
$border-radius: 0.25rem;
108
$item-spacing-v: $base-height / 2;
119
$item-spacing-h: 0.75rem;
10+
$golden: 1.618;
1211
$small-component-width: $base-height * $golden;
1312

1413
// ---- Colors ------
@@ -36,4 +35,4 @@ $button-padding: 0.6rem;
3635
$button-padding-ios: 0.5rem;
3736

3837
$box-shadow-small-components: 0 0.1rem 0.1rem $color-gray-1;
39-
$box-shadow-large-components: 0 rem(3px) rem(15px) rgba(0,0,0,0.4);
38+
$box-shadow-large-components: 0 3px 15px rgba(0,0,0,0.4);

src/styles/clay/components/checkboxgroup.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import "bourbon";
21
@import "clay";
32

43
.component-checkbox {
@@ -37,7 +36,7 @@
3736
border-radius: $border-radius;
3837
width: $base-height;
3938
height: $base-height;
40-
border: rem(2px) solid $color-gray-7;
39+
border: 2px solid $color-gray-7;
4140
flex-shrink: 0;
4241
}
4342

@@ -56,8 +55,8 @@
5655
width: 0.5rem;
5756
height: 1rem;
5857
border: 0 solid $color-white;
59-
border-right-width: rem(2px);
60-
border-bottom-width: rem(2px);
58+
border-right-width: 2px;
59+
border-bottom-width: 2px;
6160

6261
}
6362
}

src/styles/clay/components/input.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
color: $color-white;
3333
font-size: inherit;
3434
appearance: none;
35-
min-height: $item-spacing-v + ($base-height + 0rem) ;
35+
min-height: $item-spacing-v + $base-height ;
3636

37-
@include placeholder {
37+
&::placeholder {
3838
color: $color-gray-8;
3939
}
4040

4141
&:focus {
42-
@include placeholder {
42+
&::placeholder {
4343
color: $color-gray-6;
4444
}
4545
border: none;

src/styles/clay/components/radiogroup.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import "bourbon";
21
@import "clay";
32

43
.component-radio {

src/styles/clay/components/select.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import "bourbon";
21
@import "clay";
32

43
.component-select {
@@ -23,7 +22,11 @@
2322
right: 0;
2423
top: 50%;
2524
margin-top: -0.1rem;
26-
@include triangle($triangle-size, $color-orange, down);
25+
width: 0;
26+
height: 0;
27+
border-left: $triangle-size / 2 solid transparent;
28+
border-right: $triangle-size / 2 solid transparent;
29+
border-top: $triangle-size solid $color-orange;
2730
}
2831
}
2932

src/styles/clay/components/slider.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565

6666
.input {
67-
$track-height: rem(3px);
67+
$track-height: 3px;
6868

6969
display: block;
7070
position: relative;

0 commit comments

Comments
 (0)