bulma-sass 0.6.2 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +8 -2
  3. data/app/assets/stylesheets/bulma.sass +1 -1
  4. data/app/assets/stylesheets/sass/.DS_Store +0 -0
  5. data/app/assets/stylesheets/sass/base/generic.sass +2 -2
  6. data/app/assets/stylesheets/sass/base/helpers.sass +6 -0
  7. data/app/assets/stylesheets/sass/base/minireset.sass +5 -6
  8. data/app/assets/stylesheets/sass/components/breadcrumb.sass +13 -12
  9. data/app/assets/stylesheets/sass/components/card.sass +7 -0
  10. data/app/assets/stylesheets/sass/components/dropdown.sass +1 -1
  11. data/app/assets/stylesheets/sass/components/media.sass +0 -1
  12. data/app/assets/stylesheets/sass/components/message.sass +12 -5
  13. data/app/assets/stylesheets/sass/components/navbar.sass +70 -34
  14. data/app/assets/stylesheets/sass/elements/button.sass +19 -9
  15. data/app/assets/stylesheets/sass/elements/container.sass +6 -6
  16. data/app/assets/stylesheets/sass/elements/content.sass +1 -5
  17. data/app/assets/stylesheets/sass/elements/form.sass +17 -12
  18. data/app/assets/stylesheets/sass/elements/image.sass +31 -1
  19. data/app/assets/stylesheets/sass/elements/table.sass +8 -1
  20. data/app/assets/stylesheets/sass/elements/tag.sass +6 -6
  21. data/app/assets/stylesheets/sass/elements/title.sass +7 -4
  22. data/app/assets/stylesheets/sass/grid/columns.sass +14 -14
  23. data/app/assets/stylesheets/sass/layout/footer.sass +1 -1
  24. data/app/assets/stylesheets/sass/utilities/controls.sass +9 -4
  25. data/app/assets/stylesheets/sass/utilities/derived-variables.sass +4 -2
  26. data/app/assets/stylesheets/sass/utilities/functions.sass +34 -0
  27. data/app/assets/stylesheets/sass/utilities/initial-variables.sass +5 -3
  28. data/app/assets/stylesheets/sass/utilities/mixins.sass +160 -117
  29. data/docs/Gemfile +15 -0
  30. data/docs/README.md +67 -0
  31. data/docs/_assets/css/main.scss +1 -0
  32. data/docs/_config.yml +15 -0
  33. data/docs/_includes/head.html +6 -0
  34. data/docs/_layouts/default.html +16 -0
  35. data/docs/index.md +3 -0
  36. data/lib/bulma/sass/version.rb +1 -1
  37. metadata +11 -3
@@ -1,14 +1,16 @@
1
1
  $control-radius: $radius !default
2
2
  $control-radius-small: $radius-small !default
3
3
 
4
- $control-padding-vertical: calc(0.375em - 1px) !default
5
- $control-padding-horizontal: calc(0.625em - 1px) !default
4
+ $control-border-width: 1px !default
6
5
 
7
- =control
6
+ $control-padding-vertical: calc(0.375em - #{$control-border-width}) !default
7
+ $control-padding-horizontal: calc(0.625em - #{$control-border-width}) !default
8
+
9
+ %control
8
10
  -moz-appearance: none
9
11
  -webkit-appearance: none
10
12
  align-items: center
11
- border: 1px solid transparent
13
+ border: $control-border-width solid transparent
12
14
  border-radius: $control-radius
13
15
  box-shadow: none
14
16
  display: inline-flex
@@ -31,6 +33,9 @@ $control-padding-horizontal: calc(0.625em - 1px) !default
31
33
  &[disabled]
32
34
  cursor: not-allowed
33
35
 
36
+ =control
37
+ @extend %control
38
+
34
39
  // The controls sizes use mixins so they can be used at different breakpoints
35
40
  =control-small
36
41
  border-radius: $control-radius-small
@@ -75,8 +75,10 @@ $size-medium: $size-5 !default
75
75
  $size-large: $size-4 !default
76
76
 
77
77
  // Lists and maps
78
+ $custom-colors: null !default
79
+ $custom-shades: null !default
78
80
 
79
- $colors: ("white": ($white, $black), "black": ($black, $white), "light": ($light, $light-invert), "dark": ($dark, $dark-invert), "primary": ($primary, $primary-invert), "link": ($link, $link-invert), "info": ($info, $info-invert), "success": ($success, $success-invert), "warning": ($warning, $warning-invert), "danger": ($danger, $danger-invert)) !default
80
- $shades: ("black-bis": $black-bis, "black-ter": $black-ter, "grey-darker": $grey-darker, "grey-dark": $grey-dark, "grey": $grey, "grey-light": $grey-light, "grey-lighter": $grey-lighter, "white-ter": $white-ter, "white-bis": $white-bis) !default
81
+ $colors: mergeColorMaps(("white": ($white, $black), "black": ($black, $white), "light": ($light, $light-invert), "dark": ($dark, $dark-invert), "primary": ($primary, $primary-invert), "link": ($link, $link-invert), "info": ($info, $info-invert), "success": ($success, $success-invert), "warning": ($warning, $warning-invert), "danger": ($danger, $danger-invert)), $custom-colors) !default
82
+ $shades: mergeColorMaps(("black-bis": $black-bis, "black-ter": $black-ter, "grey-darker": $grey-darker, "grey-dark": $grey-dark, "grey": $grey, "grey-light": $grey-light, "grey-lighter": $grey-lighter, "white-ter": $white-ter, "white-bis": $white-bis), $custom-shades) !default
81
83
 
82
84
  $sizes: $size-1 $size-2 $size-3 $size-4 $size-5 $size-6 $size-7 !default
@@ -1,3 +1,37 @@
1
+ @function mergeColorMaps($bulma-colors, $custom-colors)
2
+ // we return at least bulma hardcoded colors
3
+ $merged-colors: $bulma-colors
4
+
5
+ // we want a map as input
6
+ @if type-of($custom-colors) == 'map'
7
+ @each $name, $components in $custom-colors
8
+ // color name should be a string and colors pair a list with at least one element
9
+ @if type-of($name) == 'string' and (type-of($components) == 'list' or type-of($components) == 'color') and length($components) >= 1
10
+ $color-base: null
11
+
12
+ // the param can either be a single color
13
+ // or a list of 2 colors
14
+ @if type-of($components) == 'color'
15
+ $color-base: $components
16
+ @else if type-of($components) == 'list'
17
+ $color-base: nth($components, 1)
18
+
19
+ $color-invert: null
20
+ // is an inverted color provided in the list
21
+ @if length($components) > 1
22
+ $color-invert: nth($components, 2)
23
+
24
+ // we only want a color as base color
25
+ @if type-of($color-base) == 'color'
26
+ // if inverted color is not provided or is not a color we compute it
27
+ @if type-of($color-invert) != 'color'
28
+ $color-invert: findColorInvert($color-base)
29
+
30
+ // we merge this colors elements as map with bulma colors (we can override them this way, no multiple definition for the same name)
31
+ $merged-colors: map_merge($merged-colors, ($name: ($color-base, $color-invert)))
32
+
33
+ @return $merged-colors
34
+
1
35
  @function powerNumber($number, $exp)
2
36
  $value: 1
3
37
  @if $exp > 0
@@ -46,22 +46,24 @@ $weight-bold: 700 !default
46
46
  // Responsiveness
47
47
 
48
48
  // The container horizontal gap, which acts as the offset for breakpoints
49
- $gap: 32px !default
49
+ $gap: 64px !default
50
50
  // 960, 1152, and 1344 have been chosen because they are divisible by both 12 and 16
51
51
  $tablet: 769px !default
52
52
  // 960px container + 4rem
53
53
  $desktop: 960px + (2 * $gap) !default
54
54
  // 1152px container + 4rem
55
55
  $widescreen: 1152px + (2 * $gap) !default
56
+ $widescreen-enabled: true !default
56
57
  // 1344px container + 4rem
57
58
  $fullhd: 1344px + (2 * $gap) !default
59
+ $fullhd-enabled: true !default
58
60
 
59
61
  // Miscellaneous
60
62
 
61
63
  $easing: ease-out !default
62
64
  $radius-small: 2px !default
63
- $radius: 3px !default
64
- $radius-large: 5px !default
65
+ $radius: 4px !default
66
+ $radius-large: 6px !default
65
67
  $radius-rounded: 290486px !default
66
68
  $speed: 86ms !default
67
69
 
@@ -1,24 +1,7 @@
1
1
  @import "initial-variables"
2
2
 
3
- =arrow($color)
4
- border: 1px solid $color
5
- border-right: 0
6
- border-top: 0
7
- content: " "
8
- display: block
9
- height: 0.5em
10
- pointer-events: none
11
- position: absolute
12
- transform: rotate(-45deg)
13
- transform-origin: center
14
- width: 0.5em
15
-
16
- =block
17
- &:not(:last-child)
18
- margin-bottom: 1.5rem
19
-
20
3
  =clearfix
21
- &:after
4
+ &::after
22
5
  clear: both
23
6
  content: " "
24
7
  display: table
@@ -32,71 +15,6 @@
32
15
  left: calc(50% - (#{$width} / 2))
33
16
  top: calc(50% - (#{$width} / 2))
34
17
 
35
- =delete
36
- +unselectable
37
- -moz-appearance: none
38
- -webkit-appearance: none
39
- background-color: rgba($black, 0.2)
40
- border: none
41
- border-radius: $radius-rounded
42
- cursor: pointer
43
- display: inline-block
44
- flex-grow: 0
45
- flex-shrink: 0
46
- font-size: 0
47
- height: 20px
48
- max-height: 20px
49
- max-width: 20px
50
- min-height: 20px
51
- min-width: 20px
52
- outline: none
53
- position: relative
54
- vertical-align: top
55
- width: 20px
56
- &:before,
57
- &:after
58
- background-color: $white
59
- content: ""
60
- display: block
61
- left: 50%
62
- position: absolute
63
- top: 50%
64
- transform: translateX(-50%) translateY(-50%) rotate(45deg)
65
- transform-origin: center center
66
- &:before
67
- height: 2px
68
- width: 50%
69
- &:after
70
- height: 50%
71
- width: 2px
72
- &:hover,
73
- &:focus
74
- background-color: rgba($black, 0.3)
75
- &:active
76
- background-color: rgba($black, 0.4)
77
- // Sizes
78
- &.is-small
79
- height: 16px
80
- max-height: 16px
81
- max-width: 16px
82
- min-height: 16px
83
- min-width: 16px
84
- width: 16px
85
- &.is-medium
86
- height: 24px
87
- max-height: 24px
88
- max-width: 24px
89
- min-height: 24px
90
- min-width: 24px
91
- width: 24px
92
- &.is-large
93
- height: 32px
94
- max-height: 32px
95
- max-width: 32px
96
- min-height: 32px
97
- min-width: 32px
98
- width: 32px
99
-
100
18
  =fa($size, $dimensions)
101
19
  display: inline-block
102
20
  font-size: $size
@@ -141,41 +59,15 @@
141
59
  &:nth-child(3)
142
60
  transform: translateY(-5px) rotate(-45deg)
143
61
 
144
- =loader
145
- animation: spinAround 500ms infinite linear
146
- border: 2px solid $border
147
- border-radius: $radius-rounded
148
- border-right-color: transparent
149
- border-top-color: transparent
150
- content: ""
151
- display: block
152
- height: 1em
153
- position: relative
154
- width: 1em
155
-
156
62
  =overflow-touch
157
63
  -webkit-overflow-scrolling: touch
158
64
 
159
- =overlay($offset: 0)
160
- bottom: $offset
161
- left: $offset
162
- position: absolute
163
- right: $offset
164
- top: $offset
165
-
166
65
  =placeholder
167
66
  $placeholders: ':-moz' ':-webkit-input' '-moz' '-ms-input'
168
67
  @each $placeholder in $placeholders
169
68
  &:#{$placeholder}-placeholder
170
69
  @content
171
70
 
172
- =unselectable
173
- -webkit-touch-callout: none
174
- -webkit-user-select: none
175
- -moz-user-select: none
176
- -ms-user-select: none
177
- user-select: none
178
-
179
71
  // Responsiveness
180
72
 
181
73
  =from($device)
@@ -207,17 +99,168 @@
207
99
  @content
208
100
 
209
101
  =desktop-only
210
- @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
211
- @content
102
+ @if $widescreen-enabled
103
+ @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
104
+ @content
105
+
106
+ =until-widescreen
107
+ @if $widescreen-enabled
108
+ @media screen and (max-width: $widescreen - 1px)
109
+ @content
212
110
 
213
111
  =widescreen
214
- @media screen and (min-width: $widescreen)
215
- @content
112
+ @if $widescreen-enabled
113
+ @media screen and (min-width: $widescreen)
114
+ @content
216
115
 
217
116
  =widescreen-only
218
- @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
219
- @content
117
+ @if $widescreen-enabled and $fullhd-enabled
118
+ @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
119
+ @content
120
+
121
+ =until-fullhd
122
+ @if $fullhd-enabled
123
+ @media screen and (max-width: $fullhd - 1px)
124
+ @content
220
125
 
221
126
  =fullhd
222
- @media screen and (min-width: $fullhd)
223
- @content
127
+ @if $fullhd-enabled
128
+ @media screen and (min-width: $fullhd)
129
+ @content
130
+
131
+ // Placeholders
132
+
133
+ %unselectable
134
+ -webkit-touch-callout: none
135
+ -webkit-user-select: none
136
+ -moz-user-select: none
137
+ -ms-user-select: none
138
+ user-select: none
139
+
140
+ =unselectable
141
+ @extend %unselectable
142
+
143
+ %arrow
144
+ border: 3px solid transparent
145
+ border-radius: 2px
146
+ border-right: 0
147
+ border-top: 0
148
+ content: " "
149
+ display: block
150
+ height: 0.625em
151
+ margin-top: -0.4375em
152
+ pointer-events: none
153
+ position: absolute
154
+ top: 50%
155
+ transform: rotate(-45deg)
156
+ transform-origin: center
157
+ width: 0.625em
158
+
159
+ =arrow($color)
160
+ @extend %arrow
161
+ border-color: $color
162
+
163
+ %block
164
+ &:not(:last-child)
165
+ margin-bottom: 1.5rem
166
+
167
+ =block
168
+ @extend %block
169
+
170
+ %delete
171
+ @extend %unselectable
172
+ -moz-appearance: none
173
+ -webkit-appearance: none
174
+ background-color: rgba($black, 0.2)
175
+ border: none
176
+ border-radius: $radius-rounded
177
+ cursor: pointer
178
+ display: inline-block
179
+ flex-grow: 0
180
+ flex-shrink: 0
181
+ font-size: 0
182
+ height: 20px
183
+ max-height: 20px
184
+ max-width: 20px
185
+ min-height: 20px
186
+ min-width: 20px
187
+ outline: none
188
+ position: relative
189
+ vertical-align: top
190
+ width: 20px
191
+ &::before,
192
+ &::after
193
+ background-color: $white
194
+ content: ""
195
+ display: block
196
+ left: 50%
197
+ position: absolute
198
+ top: 50%
199
+ transform: translateX(-50%) translateY(-50%) rotate(45deg)
200
+ transform-origin: center center
201
+ &::before
202
+ height: 2px
203
+ width: 50%
204
+ &::after
205
+ height: 50%
206
+ width: 2px
207
+ &:hover,
208
+ &:focus
209
+ background-color: rgba($black, 0.3)
210
+ &:active
211
+ background-color: rgba($black, 0.4)
212
+ // Sizes
213
+ &.is-small
214
+ height: 16px
215
+ max-height: 16px
216
+ max-width: 16px
217
+ min-height: 16px
218
+ min-width: 16px
219
+ width: 16px
220
+ &.is-medium
221
+ height: 24px
222
+ max-height: 24px
223
+ max-width: 24px
224
+ min-height: 24px
225
+ min-width: 24px
226
+ width: 24px
227
+ &.is-large
228
+ height: 32px
229
+ max-height: 32px
230
+ max-width: 32px
231
+ min-height: 32px
232
+ min-width: 32px
233
+ width: 32px
234
+
235
+ =delete
236
+ @extend %delete
237
+
238
+ %loader
239
+ animation: spinAround 500ms infinite linear
240
+ border: 2px solid $border
241
+ border-radius: $radius-rounded
242
+ border-right-color: transparent
243
+ border-top-color: transparent
244
+ content: ""
245
+ display: block
246
+ height: 1em
247
+ position: relative
248
+ width: 1em
249
+
250
+ =loader
251
+ @extend %loader
252
+
253
+ %overlay
254
+ bottom: 0
255
+ left: 0
256
+ position: absolute
257
+ right: 0
258
+ top: 0
259
+
260
+ =overlay($offset: 0)
261
+ @extend %overlay
262
+ @if $offset != 0
263
+ bottom: $offset
264
+ left: $offset
265
+ right: $offset
266
+ top: $offset
@@ -0,0 +1,15 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "jekyll", "~> 3.7.2"
4
+
5
+ group :jekyll_plugins do
6
+ gem "jekyll-assets"
7
+ gem "bulma-sass"
8
+ end
9
+
10
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
11
+ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
12
+
13
+ # Performance-booster for watching directories on Windows
14
+ gem "wdm", "~> 0.1.0" if Gem.win_platform?
15
+
@@ -0,0 +1,67 @@
1
+ # Jekyll Assets Example
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ bundle install
7
+ ```
8
+
9
+ ## Serve
10
+
11
+ ```bash
12
+ jekyll serve
13
+ ```
14
+
15
+ Now, browse to `http://localhost:4000`
16
+
17
+ ## Steps
18
+
19
+ 1. Add `jekyll-assets` and `bulma-sass` to `Gemfile` and `_config.yml`
20
+
21
+ ## Gemfile
22
+
23
+ ```ruby
24
+ group :jekyll_plugins do
25
+ gem "jekyll-assets"
26
+ gem "bulma-sass"
27
+ end
28
+ ```
29
+
30
+ ## _config.yml
31
+
32
+ ```yml
33
+ plugins:
34
+ - jekyll-assets
35
+ - bulma-sass
36
+ ```
37
+
38
+ 2. Import `bulma` in `_assets/css/main.scss`
39
+
40
+ ```scss
41
+ @import "bulma";
42
+ ```
43
+
44
+ 3. Link stylesheet in header(`_includes/head.html`)
45
+
46
+ ```html
47
+ <head>
48
+ {% asset main.css %}
49
+ </head>
50
+ ```
51
+
52
+
53
+ **Warning!!! Because you are using custom plugin, you need to build it locally instead of building from github repository.**
54
+
55
+ <details>
56
+ <summary>Show details</summary>
57
+
58
+ ```quote
59
+ Plugins on GitHub Pages
60
+ [GitHub Pages](https://pages.github.com/) is powered by Jekyll. However, all Pages sites are generated using the `--safe` option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.
61
+
62
+ You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.
63
+ ```
64
+
65
+ </details>
66
+
67
+ Read more at [https://jekyllrb.com/docs/plugins/](https://jekyllrb.com/docs/plugins/)