Skip to content

Commit bb7d221

Browse files
committed
fix: workaround for bulma functions
In Bulma v0.9 new functions were added which disabled bulma-css-vars for some lighten, darken and rgba uses like hover states. These are overridden in bulma-css-vars to work with CSS custom variables again.
1 parent 7b47443 commit bb7d221

File tree

8 files changed

+964
-191
lines changed

8 files changed

+964
-191
lines changed

demo/src/bulma-generated/bulma-colors.js

Lines changed: 688 additions & 3 deletions
Large diffs are not rendered by default.

demo/src/bulma-generated/generated-fallbacks.css

Lines changed: 155 additions & 176 deletions
Large diffs are not rendered by default.

demo/src/bulma-generated/generated-vars.sass

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,44 +51,145 @@ $yellow: var(--yellow)
5151
// derived, generated css variables
5252
#{":root"}
5353
--black--10--rgba: rgba(10, 10, 10, 0.1)
54+
--black--1000--darken: rgb(0, 0, 0)
5455
--black--2--rgba: rgba(10, 10, 10, 0.02)
5556
--black--20--rgba: rgba(10, 10, 10, 0.2)
57+
--black--25--rgba: rgba(10, 10, 10, 0.25)
58+
--black--250--darken: rgb(4, 4, 4)
59+
--black--30--rgba: rgba(10, 10, 10, 0.3)
60+
--black--40--rgba: rgba(10, 10, 10, 0.4)
5661
--black--5--rgba: rgba(10, 10, 10, 0.05)
62+
--black--500--darken: rgb(0, 0, 0)
63+
--black--70--rgba: rgba(10, 10, 10, 0.7)
5764
--black--800--lighten: rgb(30, 30, 30)
65+
--black--86--rgba: rgba(10, 10, 10, 0.86)
66+
--black--90--rgba: rgba(10, 10, 10, 0.9)
5867

68+
--blue--1000--darken: rgb(32, 91, 187)
69+
--blue--25--rgba: rgba(50, 115, 220, 0.25)
70+
--blue--250--darken: rgb(39, 108, 218)
71+
--blue--500--darken: rgb(36, 102, 209)
5972
--blue--color-invert: rgb(255, 255, 255)
73+
--blue--color-invert--500--darken: rgb(242, 242, 242)
74+
--blue--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
75+
--blue--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
6076
--blue--dark-color: rgb(34, 96, 196)
77+
--blue--dark-color--1000--lighten: rgb(60, 122, 221)
6178
--blue--light-color: rgb(238, 243, 252)
62-
79+
--blue--light-color--1000--darken: rgb(195, 212, 244)
80+
--blue--light-color--250--darken: rgb(227, 235, 250)
81+
--blue--light-color--500--darken: rgb(216, 228, 248)
82+
83+
--cyan--1000--darken: rgb(32, 125, 187)
84+
--cyan--25--rgba: rgba(50, 152, 220, 0.25)
85+
--cyan--250--darken: rgb(39, 147, 218)
86+
--cyan--500--darken: rgb(36, 140, 209)
6387
--cyan--color-invert: rgb(255, 255, 255)
88+
--cyan--color-invert--500--darken: rgb(242, 242, 242)
89+
--cyan--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
90+
--cyan--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
6491
--cyan--dark-color: rgb(29, 114, 170)
92+
--cyan--dark-color--1000--lighten: rgb(36, 143, 214)
6593
--cyan--light-color: rgb(238, 246, 252)
66-
94+
--cyan--light-color--1000--darken: rgb(195, 223, 244)
95+
--cyan--light-color--250--darken: rgb(227, 240, 250)
96+
--cyan--light-color--500--darken: rgb(216, 235, 248)
97+
98+
--green--1000--darken: rgb(52, 169, 92)
99+
--green--25--rgba: rgba(72, 199, 116, 0.25)
100+
--green--250--darken: rgb(62, 196, 109)
101+
--green--500--darken: rgb(58, 188, 103)
67102
--green--color-invert: rgb(255, 255, 255)
103+
--green--color-invert--500--darken: rgb(242, 242, 242)
104+
--green--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
105+
--green--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
68106
--green--dark-color: rgb(37, 121, 66)
107+
--green--dark-color--1000--lighten: rgb(49, 160, 87)
69108
--green--light-color: rgb(239, 250, 243)
109+
--green--light-color--1000--darken: rgb(200, 238, 214)
110+
--green--light-color--250--darken: rgb(229, 247, 236)
111+
--green--light-color--500--darken: rgb(220, 244, 228)
70112

113+
--grey--30--rgba: rgba(122, 122, 122, 0.3)
114+
115+
--grey-darker--1000--darken: rgb(29, 29, 29)
116+
--grey-darker--25--rgba: rgba(54, 54, 54, 0.25)
117+
--grey-darker--250--darken: rgb(48, 48, 48)
118+
--grey-darker--500--darken: rgb(41, 41, 41)
71119
--grey-darker--800--lighten: rgb(74, 74, 74)
72120
--grey-darker--color-invert: rgb(255, 255, 255)
73-
121+
--grey-darker--color-invert--500--darken: rgb(242, 242, 242)
122+
--grey-darker--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
123+
--grey-darker--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
124+
125+
--grey-lighter--250--darken: rgb(213, 213, 213)
126+
--grey-lighter--50--rgba: rgba(219, 219, 219, 0.5)
127+
--grey-lighter--500--darken: rgb(206, 206, 206)
128+
129+
--red--1000--darken: rgb(237, 23, 65)
130+
--red--25--rgba: rgba(241, 70, 104, 0.25)
131+
--red--250--darken: rgb(240, 58, 94)
132+
--red--500--darken: rgb(239, 46, 85)
74133
--red--color-invert: rgb(255, 255, 255)
134+
--red--color-invert--500--darken: rgb(242, 242, 242)
135+
--red--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
136+
--red--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
75137
--red--dark-color: rgb(204, 15, 53)
138+
--red--dark-color--1000--lighten: rgb(239, 31, 73)
76139
--red--light-color: rgb(254, 236, 240)
140+
--red--light-color--1000--darken: rgb(252, 188, 202)
141+
--red--light-color--250--darken: rgb(253, 224, 230)
142+
--red--light-color--500--darken: rgb(253, 212, 221)
77143

78144
--text--color-invert: rgb(255, 255, 255)
79145

146+
--text-strong--30--rgba: rgba(54, 54, 54, 0.3)
147+
148+
--turquoise--1000--darken: rgb(0, 158, 135)
149+
--turquoise--25--rgba: rgba(0, 209, 178, 0.25)
150+
--turquoise--250--darken: rgb(0, 196, 167)
151+
--turquoise--500--darken: rgb(0, 184, 156)
80152
--turquoise--color-invert: rgb(255, 255, 255)
153+
--turquoise--color-invert--500--darken: rgb(242, 242, 242)
154+
--turquoise--color-invert--70--rgba: rgba(255, 255, 255, 0.7)
155+
--turquoise--color-invert--90--rgba: rgba(255, 255, 255, 0.9)
81156
--turquoise--dark-color: rgb(0, 148, 126)
157+
--turquoise--dark-color--1000--lighten: rgb(0, 199, 169)
82158
--turquoise--light-color: rgb(235, 255, 252)
83-
159+
--turquoise--light-color--1000--darken: rgb(184, 255, 244)
160+
--turquoise--light-color--250--darken: rgb(222, 255, 250)
161+
--turquoise--light-color--500--darken: rgb(210, 255, 248)
162+
163+
--white--1000--darken: rgb(230, 230, 230)
164+
--white--25--rgba: rgba(255, 255, 255, 0.25)
165+
--white--250--darken: rgb(249, 249, 249)
166+
--white--500--darken: rgb(242, 242, 242)
167+
--white--70--rgba: rgba(255, 255, 255, 0.7)
84168
--white--800--lighten: rgb(255, 255, 255)
169+
--white--90--rgba: rgba(255, 255, 255, 0.9)
85170

86171
--white-ter--1000--darken: rgb(220, 220, 220)
172+
--white-ter--25--rgba: rgba(245, 245, 245, 0.25)
173+
--white-ter--250--darken: rgb(239, 239, 239)
87174
--white-ter--500--darken: rgb(232, 232, 232)
88175
--white-ter--800--lighten: rgb(255, 255, 255)
89176
--white-ter--color-invert: rgba(0, 0, 0, 0.7)
90-
177+
--white-ter--color-invert--500--darken: rgba(0, 0, 0, 0.7)
178+
--white-ter--color-invert--70--rgba: rgba(0, 0, 0, 0.7)
179+
--white-ter--color-invert--90--rgba: rgba(0, 0, 0, 0.9)
180+
181+
--yellow--1000--darken: rgb(255, 211, 36)
182+
--yellow--25--rgba: rgba(255, 221, 87, 0.25)
183+
--yellow--250--darken: rgb(255, 218, 74)
184+
--yellow--500--darken: rgb(255, 216, 62)
91185
--yellow--color-invert: rgba(0, 0, 0, 0.7)
186+
--yellow--color-invert--500--darken: rgba(0, 0, 0, 0.7)
187+
--yellow--color-invert--70--rgba: rgba(0, 0, 0, 0.7)
188+
--yellow--color-invert--90--rgba: rgba(0, 0, 0, 0.9)
92189
--yellow--dark-color: rgb(148, 118, 0)
190+
--yellow--dark-color--1000--lighten: rgb(199, 159, 0)
93191
--yellow--light-color: rgb(255, 251, 235)
192+
--yellow--light-color--1000--darken: rgb(255, 241, 184)
193+
--yellow--light-color--250--darken: rgb(255, 248, 222)
194+
--yellow--light-color--500--darken: rgb(255, 246, 210)
94195

docs/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.css

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/functions.sass

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
$num: str-slice(quote($perccalc), 0, -2) // remove '%''
4949
@return wrap(#{$color}--#{$num}--desaturate)
5050
51-
@function rgba($col, $val)
51+
@function rgba($col, $alpha)
5252
@if type-of($col) == 'color'
53-
@return color.change($col, $alpha: $val)
53+
@return color.change($col, $alpha: $alpha)
5454
@else
5555
$color: unwrap($col)
5656
@if str-index($color, "--") == 1
57-
@return wrap(#{$color}--#{$val * 100}--rgba)
57+
@return wrap(#{$color}--#{$alpha * 100}--rgba)
5858
@else
5959
@return color.change($color, $alpha: $perc)
6060
@@ -134,3 +134,11 @@
134134
@return change-color($color, $lightness: max($base-l, $target-l))
135135
@return $text-strong
136136
137+
@function bulmaRgba($color, $alpha)
138+
@return rgba($color, $alpha)
139+
140+
@function bulmaDarken($color, $amount)
141+
@return darken($color, $amount)
142+
143+
@function bulmaLighten($color, $amount)
144+
@return lighten($color, $amount)

lib/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bulma-css-vars",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "Bulma with CSS variables",
55
"keywords": [
66
"bulma",

0 commit comments

Comments
 (0)