bulma-rails 0.7.4 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +1 -1
  4. data/app/assets/stylesheets/bulma.sass +3 -1
  5. data/app/assets/stylesheets/sass/base/_all.sass +1 -1
  6. data/app/assets/stylesheets/sass/base/generic.sass +23 -10
  7. data/app/assets/stylesheets/sass/base/helpers.sass +1 -276
  8. data/app/assets/stylesheets/sass/base/minireset.sass +3 -8
  9. data/app/assets/stylesheets/sass/components/_all.sass +1 -1
  10. data/app/assets/stylesheets/sass/components/breadcrumb.sass +4 -4
  11. data/app/assets/stylesheets/sass/components/card.sass +19 -10
  12. data/app/assets/stylesheets/sass/components/dropdown.sass +15 -11
  13. data/app/assets/stylesheets/sass/components/level.sass +5 -3
  14. data/app/assets/stylesheets/sass/components/media.sass +14 -10
  15. data/app/assets/stylesheets/sass/components/menu.sass +16 -9
  16. data/app/assets/stylesheets/sass/components/message.sass +24 -11
  17. data/app/assets/stylesheets/sass/components/modal.sass +7 -5
  18. data/app/assets/stylesheets/sass/components/navbar.sass +43 -28
  19. data/app/assets/stylesheets/sass/components/pagination.sass +16 -10
  20. data/app/assets/stylesheets/sass/components/panel.sass +33 -15
  21. data/app/assets/stylesheets/sass/components/tabs.sass +36 -13
  22. data/app/assets/stylesheets/sass/elements/_all.sass +1 -1
  23. data/app/assets/stylesheets/sass/elements/box.sass +4 -4
  24. data/app/assets/stylesheets/sass/elements/button.sass +82 -32
  25. data/app/assets/stylesheets/sass/elements/container.sass +19 -17
  26. data/app/assets/stylesheets/sass/elements/content.sass +9 -5
  27. data/app/assets/stylesheets/sass/elements/form.sass +1 -602
  28. data/app/assets/stylesheets/sass/elements/image.sass +2 -0
  29. data/app/assets/stylesheets/sass/elements/notification.sass +19 -4
  30. data/app/assets/stylesheets/sass/elements/progress.sass +20 -14
  31. data/app/assets/stylesheets/sass/elements/table.sass +13 -8
  32. data/app/assets/stylesheets/sass/elements/tag.sass +34 -26
  33. data/app/assets/stylesheets/sass/elements/title.sass +9 -3
  34. data/app/assets/stylesheets/sass/form/_all.sass +9 -0
  35. data/app/assets/stylesheets/sass/form/checkbox-radio.sass +22 -0
  36. data/app/assets/stylesheets/sass/form/file.sass +182 -0
  37. data/app/assets/stylesheets/sass/form/input-textarea.sass +66 -0
  38. data/app/assets/stylesheets/sass/form/select.sass +87 -0
  39. data/app/assets/stylesheets/sass/form/shared.sass +57 -0
  40. data/app/assets/stylesheets/sass/form/tools.sass +215 -0
  41. data/app/assets/stylesheets/sass/grid/_all.sass +1 -0
  42. data/app/assets/stylesheets/sass/grid/columns.sass +7 -7
  43. data/app/assets/stylesheets/sass/grid/tiles.sass +8 -6
  44. data/app/assets/stylesheets/sass/helpers/_all.sass +12 -0
  45. data/app/assets/stylesheets/sass/helpers/color.sass +37 -0
  46. data/app/assets/stylesheets/sass/helpers/flexbox.sass +35 -0
  47. data/app/assets/stylesheets/sass/helpers/float.sass +8 -0
  48. data/app/assets/stylesheets/sass/helpers/other.sass +11 -0
  49. data/app/assets/stylesheets/sass/helpers/overflow.sass +2 -0
  50. data/app/assets/stylesheets/sass/helpers/position.sass +5 -0
  51. data/app/assets/stylesheets/sass/helpers/spacing.sass +31 -0
  52. data/app/assets/stylesheets/sass/helpers/typography.sass +98 -0
  53. data/app/assets/stylesheets/sass/helpers/visibility.sass +122 -0
  54. data/app/assets/stylesheets/sass/layout/_all.sass +1 -0
  55. data/app/assets/stylesheets/sass/layout/footer.sass +4 -1
  56. data/app/assets/stylesheets/sass/layout/hero.sass +26 -35
  57. data/app/assets/stylesheets/sass/utilities/_all.sass +1 -0
  58. data/app/assets/stylesheets/sass/utilities/controls.sass +3 -3
  59. data/app/assets/stylesheets/sass/utilities/derived-variables.sass +32 -10
  60. data/app/assets/stylesheets/sass/utilities/functions.sass +68 -15
  61. data/app/assets/stylesheets/sass/utilities/initial-variables.sass +10 -4
  62. data/app/assets/stylesheets/sass/utilities/mixins.sass +31 -7
  63. data/bulma-rails.gemspec +2 -2
  64. metadata +23 -7
  65. data/app/assets/stylesheets/sass/components/list.sass +0 -39
@@ -9,6 +9,8 @@ $dimensions: 16 24 32 48 64 96 128 !default
9
9
  width: 100%
10
10
  &.is-rounded
11
11
  border-radius: $radius-rounded
12
+ &.is-fullwidth
13
+ width: 100%
12
14
  // Ratio
13
15
  &.is-square,
14
16
  &.is-1by1,
@@ -1,13 +1,21 @@
1
1
  $notification-background-color: $background !default
2
+ $notification-code-background-color: $scheme-main !default
2
3
  $notification-radius: $radius !default
3
4
  $notification-padding: 1.25rem 2.5rem 1.25rem 1.5rem !default
5
+ $notification-padding-ltr: 1.25rem 2.5rem 1.25rem 1.5rem !default
6
+ $notification-padding-rtl: 1.25rem 1.5rem 1.25rem 2.5rem !default
7
+
8
+ $notification-colors: $colors !default
4
9
 
5
10
  .notification
6
11
  @extend %block
7
12
  background-color: $notification-background-color
8
13
  border-radius: $notification-radius
9
- padding: $notification-padding
10
14
  position: relative
15
+ +ltr
16
+ padding: $notification-padding-ltr
17
+ +rtl
18
+ padding: $notification-padding-rtl
11
19
  a:not(.button):not(.dropdown-item)
12
20
  color: currentColor
13
21
  text-decoration: underline
@@ -15,21 +23,28 @@ $notification-padding: 1.25rem 2.5rem 1.25rem 1.5rem !default
15
23
  color: currentColor
16
24
  code,
17
25
  pre
18
- background: $white
26
+ background: $notification-code-background-color
19
27
  pre code
20
28
  background: transparent
21
29
  & > .delete
30
+ +ltr-position(0.5rem)
22
31
  position: absolute
23
- right: 0.5rem
24
32
  top: 0.5rem
25
33
  .title,
26
34
  .subtitle,
27
35
  .content
28
36
  color: currentColor
29
37
  // Colors
30
- @each $name, $pair in $colors
38
+ @each $name, $pair in $notification-colors
31
39
  $color: nth($pair, 1)
32
40
  $color-invert: nth($pair, 2)
33
41
  &.is-#{$name}
34
42
  background-color: $color
35
43
  color: $color-invert
44
+ // If light and dark colors are provided
45
+ @if length($pair) >= 4
46
+ $color-light: nth($pair, 3)
47
+ $color-dark: nth($pair, 4)
48
+ &.is-light
49
+ background-color: $color-light
50
+ color: $color-dark
@@ -1,14 +1,17 @@
1
- $progress-bar-background-color: $border !default
1
+ $progress-bar-background-color: $border-light !default
2
2
  $progress-value-background-color: $text !default
3
+ $progress-border-radius: $radius-rounded !default
3
4
 
4
5
  $progress-indeterminate-duration: 1.5s !default
5
6
 
7
+ $progress-colors: $colors !default
8
+
6
9
  .progress
7
10
  @extend %block
8
11
  -moz-appearance: none
9
12
  -webkit-appearance: none
10
13
  border: none
11
- border-radius: $radius-rounded
14
+ border-radius: $progress-border-radius
12
15
  display: block
13
16
  height: $size-normal
14
17
  overflow: hidden
@@ -23,6 +26,19 @@ $progress-indeterminate-duration: 1.5s !default
23
26
  &::-ms-fill
24
27
  background-color: $progress-value-background-color
25
28
  border: none
29
+ // Colors
30
+ @each $name, $pair in $progress-colors
31
+ $color: nth($pair, 1)
32
+ &.is-#{$name}
33
+ &::-webkit-progress-value
34
+ background-color: $color
35
+ &::-moz-progress-bar
36
+ background-color: $color
37
+ &::-ms-fill
38
+ background-color: $color
39
+ &:indeterminate
40
+ background-image: linear-gradient(to right, $color 30%, $progress-bar-background-color 30%)
41
+
26
42
  &:indeterminate
27
43
  animation-duration: $progress-indeterminate-duration
28
44
  animation-iteration-count: infinite
@@ -37,18 +53,8 @@ $progress-indeterminate-duration: 1.5s !default
37
53
  background-color: transparent
38
54
  &::-moz-progress-bar
39
55
  background-color: transparent
40
- // Colors
41
- @each $name, $pair in $colors
42
- $color: nth($pair, 1)
43
- &.is-#{$name}
44
- &::-webkit-progress-value
45
- background-color: $color
46
- &::-moz-progress-bar
47
- background-color: $color
48
- &::-ms-fill
49
- background-color: $color
50
- &:indeterminate
51
- background-image: linear-gradient(to right, $color 30%, $progress-bar-background-color 30%)
56
+ &::-ms-fill
57
+ animation-name: none
52
58
 
53
59
  // Sizes
54
60
  &.is-small
@@ -1,7 +1,7 @@
1
- $table-color: $grey-darker !default
2
- $table-background-color: $white !default
1
+ $table-color: $text-strong !default
2
+ $table-background-color: $scheme-main !default
3
3
 
4
- $table-cell-border: 1px solid $grey-lighter !default
4
+ $table-cell-border: 1px solid $border !default
5
5
  $table-cell-border-width: 0 0 1px !default
6
6
  $table-cell-padding: 0.5em 0.75em !default
7
7
  $table-cell-heading-color: $text-strong !default
@@ -15,13 +15,15 @@ $table-head-background-color: transparent !default
15
15
  $table-body-background-color: transparent !default
16
16
  $table-foot-background-color: transparent !default
17
17
 
18
- $table-row-hover-background-color: $white-bis !default
18
+ $table-row-hover-background-color: $scheme-main-bis !default
19
19
 
20
20
  $table-row-active-background-color: $primary !default
21
21
  $table-row-active-color: $primary-invert !default
22
22
 
23
- $table-striped-row-even-background-color: $white-bis !default
24
- $table-striped-row-even-hover-background-color: $white-ter !default
23
+ $table-striped-row-even-background-color: $scheme-main-bis !default
24
+ $table-striped-row-even-hover-background-color: $scheme-main-ter !default
25
+
26
+ $table-colors: $colors !default
25
27
 
26
28
  .table
27
29
  @extend %block
@@ -34,7 +36,7 @@ $table-striped-row-even-hover-background-color: $white-ter !default
34
36
  padding: $table-cell-padding
35
37
  vertical-align: top
36
38
  // Colors
37
- @each $name, $pair in $colors
39
+ @each $name, $pair in $table-colors
38
40
  $color: nth($pair, 1)
39
41
  $color-invert: nth($pair, 2)
40
42
  &.is-#{$name}
@@ -51,9 +53,12 @@ $table-striped-row-even-hover-background-color: $white-ter !default
51
53
  a,
52
54
  strong
53
55
  color: currentColor
56
+ &.is-vcentered
57
+ vertical-align: middle
54
58
  th
55
59
  color: $table-cell-heading-color
56
- text-align: left
60
+ &:not([align])
61
+ text-align: inherit
57
62
  tr
58
63
  &.is-selected
59
64
  background-color: $table-row-active-background-color
@@ -3,6 +3,8 @@ $tag-color: $text !default
3
3
  $tag-radius: $radius !default
4
4
  $tag-delete-margin: 1px !default
5
5
 
6
+ $tag-colors: $colors !default
7
+
6
8
  .tags
7
9
  align-items: center
8
10
  display: flex
@@ -11,7 +13,7 @@ $tag-delete-margin: 1px !default
11
13
  .tag
12
14
  margin-bottom: 0.5rem
13
15
  &:not(:last-child)
14
- margin-right: 0.5rem
16
+ +ltr-property("margin", 0.5rem)
15
17
  &:last-child
16
18
  margin-bottom: -0.5rem
17
19
  &:not(:last-child)
@@ -23,15 +25,6 @@ $tag-delete-margin: 1px !default
23
25
  &.are-large
24
26
  .tag:not(.is-normal):not(.is-medium)
25
27
  font-size: $size-medium
26
- &.has-addons
27
- .tag
28
- margin-right: 0
29
- &:not(:first-child)
30
- border-bottom-left-radius: 0
31
- border-top-left-radius: 0
32
- &:not(:last-child)
33
- border-bottom-right-radius: 0
34
- border-top-right-radius: 0
35
28
  &.is-centered
36
29
  justify-content: center
37
30
  .tag
@@ -46,14 +39,22 @@ $tag-delete-margin: 1px !default
46
39
  margin-right: 0
47
40
  &.has-addons
48
41
  .tag
49
- margin-right: 0
42
+ +ltr-property("margin", 0)
50
43
  &:not(:first-child)
51
- margin-left: 0
52
- border-bottom-left-radius: 0
53
- border-top-left-radius: 0
44
+ +ltr-property("margin", 0, false)
45
+ +ltr
46
+ border-top-left-radius: 0
47
+ border-bottom-left-radius: 0
48
+ +rtl
49
+ border-top-right-radius: 0
50
+ border-bottom-right-radius: 0
54
51
  &:not(:last-child)
55
- border-bottom-right-radius: 0
56
- border-top-right-radius: 0
52
+ +ltr
53
+ border-top-right-radius: 0
54
+ border-bottom-right-radius: 0
55
+ +rtl
56
+ border-top-left-radius: 0
57
+ border-bottom-left-radius: 0
57
58
 
58
59
  .tag:not(body)
59
60
  align-items: center
@@ -69,15 +70,22 @@ $tag-delete-margin: 1px !default
69
70
  padding-right: 0.75em
70
71
  white-space: nowrap
71
72
  .delete
72
- margin-left: 0.25rem
73
- margin-right: -0.375rem
73
+ +ltr-property("margin", 0.25rem, false)
74
+ +ltr-property("margin", -0.375rem)
74
75
  // Colors
75
- @each $name, $pair in $colors
76
+ @each $name, $pair in $tag-colors
76
77
  $color: nth($pair, 1)
77
78
  $color-invert: nth($pair, 2)
78
79
  &.is-#{$name}
79
80
  background-color: $color
80
81
  color: $color-invert
82
+ // If a light and dark colors are provided
83
+ @if length($pair) > 3
84
+ $color-light: nth($pair, 3)
85
+ $color-dark: nth($pair, 4)
86
+ &.is-light
87
+ background-color: $color-light
88
+ color: $color-dark
81
89
  // Sizes
82
90
  &.is-normal
83
91
  font-size: $size-small
@@ -87,17 +95,17 @@ $tag-delete-margin: 1px !default
87
95
  font-size: $size-medium
88
96
  .icon
89
97
  &:first-child:not(:last-child)
90
- margin-left: -0.375em
91
- margin-right: 0.1875em
98
+ +ltr-property("margin", -0.375em, false)
99
+ +ltr-property("margin", 0.1875em)
92
100
  &:last-child:not(:first-child)
93
- margin-left: 0.1875em
94
- margin-right: -0.375em
101
+ +ltr-property("margin", 0.1875em, false)
102
+ +ltr-property("margin", -0.375em)
95
103
  &:first-child:last-child
96
- margin-left: -0.375em
97
- margin-right: -0.375em
104
+ +ltr-property("margin", -0.375em, false)
105
+ +ltr-property("margin", -0.375em)
98
106
  // Modifiers
99
107
  &.is-delete
100
- margin-left: $tag-delete-margin
108
+ +ltr-property("margin", $tag-delete-margin, false)
101
109
  padding: 0
102
110
  position: relative
103
111
  width: 2em
@@ -1,4 +1,5 @@
1
- $title-color: $grey-darker !default
1
+ $title-color: $text-strong !default
2
+ $title-family: false !default
2
3
  $title-size: $size-3 !default
3
4
  $title-weight: $weight-semibold !default
4
5
  $title-line-height: 1.125 !default
@@ -7,11 +8,12 @@ $title-strong-weight: inherit !default
7
8
  $title-sub-size: 0.75em !default
8
9
  $title-sup-size: 0.75em !default
9
10
 
10
- $subtitle-color: $grey-dark !default
11
+ $subtitle-color: $text !default
12
+ $subtitle-family: false !default
11
13
  $subtitle-size: $size-5 !default
12
14
  $subtitle-weight: $weight-normal !default
13
15
  $subtitle-line-height: 1.25 !default
14
- $subtitle-strong-color: $grey-darker !default
16
+ $subtitle-strong-color: $text-strong !default
15
17
  $subtitle-strong-weight: $weight-semibold !default
16
18
  $subtitle-negative-margin: -1.25rem !default
17
19
 
@@ -31,6 +33,8 @@ $subtitle-negative-margin: -1.25rem !default
31
33
 
32
34
  .title
33
35
  color: $title-color
36
+ @if $title-family
37
+ font-family: $title-family
34
38
  font-size: $title-size
35
39
  font-weight: $title-weight
36
40
  line-height: $title-line-height
@@ -49,6 +53,8 @@ $subtitle-negative-margin: -1.25rem !default
49
53
 
50
54
  .subtitle
51
55
  color: $subtitle-color
56
+ @if $subtitle-family
57
+ font-family: $subtitle-family
52
58
  font-size: $subtitle-size
53
59
  font-weight: $subtitle-weight
54
60
  line-height: $subtitle-line-height
@@ -0,0 +1,9 @@
1
+ /* Bulma Form */
2
+ @charset "utf-8"
3
+
4
+ @import "shared.sass"
5
+ @import "input-textarea.sass"
6
+ @import "checkbox-radio.sass"
7
+ @import "select.sass"
8
+ @import "file.sass"
9
+ @import "tools.sass"
@@ -0,0 +1,22 @@
1
+ %checkbox-radio
2
+ cursor: pointer
3
+ display: inline-block
4
+ line-height: 1.25
5
+ position: relative
6
+ input
7
+ cursor: pointer
8
+ &:hover
9
+ color: $input-hover-color
10
+ &[disabled],
11
+ fieldset[disabled] &,
12
+ input[disabled]
13
+ color: $input-disabled-color
14
+ cursor: not-allowed
15
+
16
+ .checkbox
17
+ @extend %checkbox-radio
18
+
19
+ .radio
20
+ @extend %checkbox-radio
21
+ & + .radio
22
+ +ltr-property("margin", 0.5em, false)
@@ -0,0 +1,182 @@
1
+ $file-border-color: $border !default
2
+ $file-radius: $radius !default
3
+
4
+ $file-cta-background-color: $scheme-main-ter !default
5
+ $file-cta-color: $text !default
6
+ $file-cta-hover-color: $text-strong !default
7
+ $file-cta-active-color: $text-strong !default
8
+
9
+ $file-name-border-color: $border !default
10
+ $file-name-border-style: solid !default
11
+ $file-name-border-width: 1px 1px 1px 0 !default
12
+ $file-name-max-width: 16em !default
13
+
14
+ $file-colors: $form-colors !default
15
+
16
+ .file
17
+ @extend %unselectable
18
+ align-items: stretch
19
+ display: flex
20
+ justify-content: flex-start
21
+ position: relative
22
+ // Colors
23
+ @each $name, $pair in $file-colors
24
+ $color: nth($pair, 1)
25
+ $color-invert: nth($pair, 2)
26
+ &.is-#{$name}
27
+ .file-cta
28
+ background-color: $color
29
+ border-color: transparent
30
+ color: $color-invert
31
+ &:hover,
32
+ &.is-hovered
33
+ .file-cta
34
+ background-color: bulmaDarken($color, 2.5%)
35
+ border-color: transparent
36
+ color: $color-invert
37
+ &:focus,
38
+ &.is-focused
39
+ .file-cta
40
+ border-color: transparent
41
+ box-shadow: 0 0 0.5em bulmaRgba($color, 0.25)
42
+ color: $color-invert
43
+ &:active,
44
+ &.is-active
45
+ .file-cta
46
+ background-color: bulmaDarken($color, 5%)
47
+ border-color: transparent
48
+ color: $color-invert
49
+ // Sizes
50
+ &.is-small
51
+ font-size: $size-small
52
+ &.is-medium
53
+ font-size: $size-medium
54
+ .file-icon
55
+ .fa
56
+ font-size: 21px
57
+ &.is-large
58
+ font-size: $size-large
59
+ .file-icon
60
+ .fa
61
+ font-size: 28px
62
+ // Modifiers
63
+ &.has-name
64
+ .file-cta
65
+ border-bottom-right-radius: 0
66
+ border-top-right-radius: 0
67
+ .file-name
68
+ border-bottom-left-radius: 0
69
+ border-top-left-radius: 0
70
+ &.is-empty
71
+ .file-cta
72
+ border-radius: $file-radius
73
+ .file-name
74
+ display: none
75
+ &.is-boxed
76
+ .file-label
77
+ flex-direction: column
78
+ .file-cta
79
+ flex-direction: column
80
+ height: auto
81
+ padding: 1em 3em
82
+ .file-name
83
+ border-width: 0 1px 1px
84
+ .file-icon
85
+ height: 1.5em
86
+ width: 1.5em
87
+ .fa
88
+ font-size: 21px
89
+ &.is-small
90
+ .file-icon .fa
91
+ font-size: 14px
92
+ &.is-medium
93
+ .file-icon .fa
94
+ font-size: 28px
95
+ &.is-large
96
+ .file-icon .fa
97
+ font-size: 35px
98
+ &.has-name
99
+ .file-cta
100
+ border-radius: $file-radius $file-radius 0 0
101
+ .file-name
102
+ border-radius: 0 0 $file-radius $file-radius
103
+ border-width: 0 1px 1px
104
+ &.is-centered
105
+ justify-content: center
106
+ &.is-fullwidth
107
+ .file-label
108
+ width: 100%
109
+ .file-name
110
+ flex-grow: 1
111
+ max-width: none
112
+ &.is-right
113
+ justify-content: flex-end
114
+ .file-cta
115
+ border-radius: 0 $file-radius $file-radius 0
116
+ .file-name
117
+ border-radius: $file-radius 0 0 $file-radius
118
+ border-width: 1px 0 1px 1px
119
+ order: -1
120
+
121
+ .file-label
122
+ align-items: stretch
123
+ display: flex
124
+ cursor: pointer
125
+ justify-content: flex-start
126
+ overflow: hidden
127
+ position: relative
128
+ &:hover
129
+ .file-cta
130
+ background-color: bulmaDarken($file-cta-background-color, 2.5%)
131
+ color: $file-cta-hover-color
132
+ .file-name
133
+ border-color: bulmaDarken($file-name-border-color, 2.5%)
134
+ &:active
135
+ .file-cta
136
+ background-color: bulmaDarken($file-cta-background-color, 5%)
137
+ color: $file-cta-active-color
138
+ .file-name
139
+ border-color: bulmaDarken($file-name-border-color, 5%)
140
+
141
+ .file-input
142
+ height: 100%
143
+ left: 0
144
+ opacity: 0
145
+ outline: none
146
+ position: absolute
147
+ top: 0
148
+ width: 100%
149
+
150
+ .file-cta,
151
+ .file-name
152
+ @extend %control
153
+ border-color: $file-border-color
154
+ border-radius: $file-radius
155
+ font-size: 1em
156
+ padding-left: 1em
157
+ padding-right: 1em
158
+ white-space: nowrap
159
+
160
+ .file-cta
161
+ background-color: $file-cta-background-color
162
+ color: $file-cta-color
163
+
164
+ .file-name
165
+ border-color: $file-name-border-color
166
+ border-style: $file-name-border-style
167
+ border-width: $file-name-border-width
168
+ display: block
169
+ max-width: $file-name-max-width
170
+ overflow: hidden
171
+ text-align: inherit
172
+ text-overflow: ellipsis
173
+
174
+ .file-icon
175
+ align-items: center
176
+ display: flex
177
+ height: 1em
178
+ justify-content: center
179
+ +ltr-property("margin", 0.5em)
180
+ width: 1em
181
+ .fa
182
+ font-size: 14px