@oruga-ui/theme-oruga 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +4 -4
  2. package/dist/scss/components/_autocomplete.scss +3 -12
  3. package/dist/scss/components/_breadcrumb.scss +122 -103
  4. package/dist/scss/components/_button.scss +228 -173
  5. package/dist/scss/components/_carousel.scss +164 -142
  6. package/dist/scss/components/_checkbox.scss +118 -118
  7. package/dist/scss/components/_collapse.scss +1 -1
  8. package/dist/scss/components/_datepicker.scss +228 -290
  9. package/dist/scss/components/_datetimepicker.scss +8 -2
  10. package/dist/scss/components/_dropdown.scss +191 -164
  11. package/dist/scss/components/_field.scss +68 -39
  12. package/dist/scss/components/_icon.scss +24 -29
  13. package/dist/scss/components/_input.scss +112 -97
  14. package/dist/scss/components/_loading.scss +35 -15
  15. package/dist/scss/components/_menu.scss +113 -109
  16. package/dist/scss/components/_modal.scss +112 -50
  17. package/dist/scss/components/_notification.scss +113 -97
  18. package/dist/scss/components/_pagination.scss +173 -106
  19. package/dist/scss/components/_radio.scss +91 -84
  20. package/dist/scss/components/_select.scss +108 -115
  21. package/dist/scss/components/_sidebar.scss +102 -101
  22. package/dist/scss/components/_skeleton.scss +50 -39
  23. package/dist/scss/components/_slider.scss +221 -159
  24. package/dist/scss/components/_steps.scss +223 -261
  25. package/dist/scss/components/_switch.scss +126 -90
  26. package/dist/scss/components/_table.scss +307 -251
  27. package/dist/scss/components/_tabs.scss +360 -247
  28. package/dist/scss/components/_tag.scss +95 -39
  29. package/dist/scss/components/_taginput.scss +48 -36
  30. package/dist/scss/components/_timepicker.scss +61 -62
  31. package/dist/scss/components/_tooltip.scss +129 -254
  32. package/dist/scss/components/_upload.scss +83 -35
  33. package/dist/scss/theme-build.scss +9 -0
  34. package/dist/scss/theme.scss +42 -0
  35. package/dist/scss/utils/_animations.scss +30 -9
  36. package/dist/scss/utils/_base.scss +6 -4
  37. package/dist/scss/utils/_helpers.scss +84 -22
  38. package/dist/scss/utils/_root.scss +82 -29
  39. package/dist/scss/utils/_variables.scss +64 -42
  40. package/dist/theme.css +2 -0
  41. package/dist/theme.js +1 -1
  42. package/package.json +26 -19
  43. package/dist/oruga.css +0 -2
  44. package/dist/scss/oruga-build.scss +0 -9
  45. package/dist/scss/oruga.scss +0 -42
@@ -1,144 +1,148 @@
1
1
  @use "sass:list";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
2
4
 
3
5
  /* @docs */
4
- $select-background-color: #fff !default;
5
- $select-border-color: var(--#{$prefix}grey-lighter) !default;
6
+ $select-height: h.useVar("control-height") !default;
7
+ $select-padding: h.useVar("control-padding-vertical")
8
+ h.useVar("control-padding-horizontal") !default;
9
+ $select-disabled-opacity: h.useVar("control-disabled-opacity") !default;
10
+
11
+ $select-color: h.useVar("font-color") !default;
12
+ $select-font-size: h.useVar("font-size") !default;
13
+ $select-font-weight: h.useVar("font-weight") !default;
14
+ $select-line-height: h.useVar("line-height") !default;
15
+
16
+ $select-box-shadow: h.useVar("control-box-shadow-inset") !default;
17
+ $select-background-color: h.useVar("control-brackground-color") !default;
18
+ $select-border-color: h.useVar("control-border-color") !default;
6
19
  $select-border-style: solid !default;
7
- $select-border-width: 1px !default;
8
- $select-border-radius: var(--#{$prefix}base-border-radius) !default;
9
- $select-rounded-border-radius: var(
10
- --#{$prefix}base-border-radius-rounded
11
- ) !default;
12
- $select-box-shadow: $control-box-shadow !default;
13
- $select-color: #363636 !default;
14
- $select-icon-zindex: 4 !default;
15
- $select-height: $control-height !default;
16
- $select-line-height: var(--#{$prefix}base-line-height) !default;
17
- $select-margin: 0 !default;
18
- $select-padding: $control-padding-vertical $control-padding-horizontal !default;
19
- $select-arrow-color: $select-color !default;
20
- $select-arrow-size: 1rem !default;
21
- $select-placeholder-opacity: var(--#{$prefix}base-disabled-opacity) !default;
20
+ $select-border-width: h.useVar("control-border-width") !default;
21
+ $select-border-radius: h.useVar("border-radius") !default;
22
+ $select-border-radius-rounded: h.useVar("border-radius-rounded") !default;
23
+
24
+ $select-multiple-padding: h.useVar("control-spacer") !default;
25
+ $select-arrow-color: vars.$font-color !default;
26
+ $select-arrow-size: 1em !default;
22
27
  /* @docs */
23
28
 
24
29
  @function svg_arrow($color) {
25
- $start: '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:serif="http://www.serif.com/" width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">';
26
- $content: '<g transform="matrix(5.70052,0,0,5.70052,-1329.79,-547.054)"><path d="M233.451,101.749L235.617,99.422L242.013,105.565L248.463,99.422L250.642,101.749L242.013,110.052L233.451,101.749Z" style="fill:#{$color};stroke:white;stroke-width:0.18px;"/></g>';
30
+ $start: '<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">';
31
+ $content: '<g transform="matrix(5.70052,0,0,5.70052,-1329.79,-547.054)"><path d="M233.451,101.749L235.617,99.422L242.013,105.565L248.463,99.422L250.642,101.749L242.013,110.052L233.451,101.749Z" style="fill:#{$color}"/></g>';
27
32
  $end: "</svg>";
28
33
 
29
- @return svg-encode("#{$start}#{$content}#{$end}");
34
+ @return h.svg-encode("#{$start}#{$content}#{$end}");
30
35
  }
31
36
 
32
37
  .o-select {
33
- display: inline-flex;
38
+ @include h.defineVar("select-height", $select-height);
39
+ @include h.defineVar("select-padding", $select-padding);
40
+ @include h.defineVar("select-disabled-opacity", $select-disabled-opacity);
41
+
42
+ @include h.defineVar("select-color", $select-color);
43
+ @include h.defineVar("select-font-size", $select-font-size);
44
+ @include h.defineVar("select-font-weight", $select-font-weight);
45
+ @include h.defineVar("select-line-height", $select-line-height);
46
+
47
+ @include h.defineVar("select-box-shadow", $select-box-shadow);
48
+ @include h.defineVar("select-background-color", $select-background-color);
49
+ @include h.defineVar("select-border-color", $select-border-color);
50
+ @include h.defineVar("select-border-style", $select-border-style);
51
+ @include h.defineVar("select-border-width", $select-border-width);
52
+ @include h.defineVar("select-border-radius", $select-border-radius);
53
+ @include h.defineVar(
54
+ "select-border-radius-rounded",
55
+ $select-border-radius-rounded
56
+ );
57
+ @include h.defineVar("select-arrow-size", $select-arrow-size);
58
+ @include h.defineVar(
59
+ "select-arrow-background-image",
60
+ url(svg_arrow($select-arrow-color))
61
+ );
62
+ @include h.defineVar("select-multiple-padding", $select-multiple-padding);
63
+
64
+ // define focus shadow effect
65
+ @include h.focusable(".o-select__input");
66
+
67
+ display: inline-block;
34
68
  position: relative;
35
69
 
70
+ // size variants
71
+ @each $name, $value in vars.$sizes {
72
+ &--#{$name} {
73
+ @include h.defineVar("select-font-size", h.useVar("size-#{$name}"));
74
+ }
75
+ }
76
+
77
+ // color variants
78
+ @each $name, $pair in vars.$colors {
79
+ $color: list.nth($pair, 1);
80
+ &--#{$name} {
81
+ @include h.defineVar("select-border-color", h.useVar($name));
82
+ @include h.defineVar(
83
+ "select-arrow-background-image",
84
+ url(svg_arrow($color))
85
+ );
86
+ }
87
+ }
88
+
36
89
  &__input {
37
- -moz-appearance: none;
38
- -webkit-appearance: none;
90
+ // remove default appearance
91
+ @include h.removeAppearance;
92
+
39
93
  display: inline-block;
40
94
  position: relative;
41
- vertical-align: top;
42
- cursor: pointer;
43
- justify-content: flex-start;
44
- align-items: center;
45
-
46
- box-shadow: var(--#{$prefix}select-box-shadow, $select-box-shadow);
47
- background-color: var(
48
- --#{$prefix}select-background-color,
49
- $select-background-color
50
- );
51
- border-color: var(
52
- --#{$prefix}select-border-color,
53
- $select-border-color
54
- );
55
- border-width: var(
56
- --#{$prefix}select-border-width,
57
- $select-border-width
58
- );
59
- border-style: var(
60
- --#{$prefix}select-border-style,
61
- $select-border-style
62
- );
63
- border-radius: var(
64
- --#{$prefix}select-border-radius,
65
- $select-border-radius
66
- );
67
- color: var(--#{$prefix}select-color, $select-color);
68
- font-size: var(--#{$prefix}base-font-size, $base-font-size);
69
- height: var(--#{$prefix}select-height, $select-height);
70
- line-height: var(--#{$prefix}select-line-height, $select-line-height);
71
- padding: var(--#{$prefix}select-padding, $select-padding);
72
- margin: var(--#{$prefix}select-margin, $select-margin);
95
+
96
+ height: h.useVar("select-height");
97
+ padding: h.useVar("select-padding");
98
+
99
+ color: h.useVar("select-color");
100
+ font-size: h.useVar("select-font-size");
101
+ font-weight: h.useVar("select-font-weight");
102
+ line-height: h.useVar("select-line-height");
103
+
104
+ box-shadow: h.useVar("select-box-shadow");
105
+ background-color: h.useVar("select-background-color");
106
+ border-color: h.useVar("select-border-color");
107
+ border-style: h.useVar("select-border-style");
108
+ border-width: h.useVar("select-border-width");
109
+ border-radius: h.useVar("select-border-radius");
73
110
 
74
111
  &--arrowed {
75
- background-image: url(svg_arrow($select-arrow-color));
112
+ background-image: h.useVar("select-arrow-background-image");
76
113
  background-repeat: no-repeat;
77
- background-size: var(
78
- --#{$prefix}select-arrow-size,
79
- $select-arrow-size
80
- );
114
+ background-size: h.useVar("select-arrow-size");
81
115
  background-position: calc(
82
- 100% - var(
83
- --#{$prefix}select-arrow-size,
84
- $select-arrow-size
85
- ) *
86
- 0.5
116
+ 100% - h.useVar("select-arrow-size") * 0.5
87
117
  )
88
118
  center;
89
- padding-right: calc(
90
- var(--#{$prefix}select-arrow-size, $select-arrow-size) * 2
91
- );
92
- }
93
-
94
- &--placeholder {
95
- opacity: var(
96
- --#{$prefix}select-placeholder-opacity,
97
- $select-placeholder-opacity
98
- );
119
+ padding-right: calc(h.useVar("select-arrow-size") * 2);
99
120
  }
100
121
 
101
122
  &--iconspace-left {
102
- padding-left: var(--#{$prefix}select-height, $select-height);
123
+ padding-left: h.useVar("select-height");
103
124
  }
104
125
 
105
126
  &--iconspace-right {
106
- padding-right: var(--#{$prefix}select-height, $select-height);
107
- }
108
-
109
- &[disabled] {
110
- cursor: inherit;
127
+ padding-right: h.useVar("select-height");
111
128
  }
112
129
  }
113
130
 
114
- // size sizes
115
- @each $name, $value in $sizes {
116
- &--#{$name} .o-select__input {
117
- font-size: var(--#{$prefix}select-font-size-#{$name}, $value);
118
- }
119
- }
120
-
121
- // color variants
122
- @each $name, $pair in $colors {
123
- $color: list.nth($pair, 1);
124
-
125
- &--#{$name} .o-select__input {
126
- --#{$prefix}focus: #{createFocus($color)};
127
-
128
- border-color: var(--#{$prefix}variant-#{$name}, $color);
129
- }
131
+ &--rounded {
132
+ @include h.defineVar(
133
+ "select-border-radius",
134
+ h.useVar("select-border-radius-rounded")
135
+ );
130
136
  }
131
137
 
132
- &--rounded .o-select__input {
133
- border-radius: var(
134
- --#{$prefix}select-rounded-border-radius,
135
- $select-rounded-border-radius
136
- );
138
+ &--disabled {
139
+ @include h.disabled(h.useVar("select-disabled-opacity"));
137
140
  }
138
141
 
139
142
  &--expanded {
140
143
  width: 100%;
141
144
  flex-grow: 1;
145
+ flex-shrink: 1;
142
146
 
143
147
  .o-select__input {
144
148
  width: 100%;
@@ -147,7 +151,7 @@ $select-placeholder-opacity: var(--#{$prefix}base-disabled-opacity) !default;
147
151
 
148
152
  &--multiple .o-select__input {
149
153
  height: auto;
150
- padding: 0;
154
+ padding: h.useVar("select-multiple-padding");
151
155
  }
152
156
 
153
157
  &__icon-left,
@@ -155,8 +159,7 @@ $select-placeholder-opacity: var(--#{$prefix}base-disabled-opacity) !default;
155
159
  position: absolute;
156
160
  top: 0;
157
161
  height: 100%;
158
- width: var(--#{$prefix}select-height, $select-height);
159
- z-index: var(--#{$prefix}select-icon-zindex, $select-icon-zindex);
162
+ width: h.useVar("select-height");
160
163
  }
161
164
 
162
165
  &__icon-right {
@@ -166,14 +169,4 @@ $select-placeholder-opacity: var(--#{$prefix}base-disabled-opacity) !default;
166
169
  &__icon-left {
167
170
  left: 0;
168
171
  }
169
-
170
- // focus effect
171
- &:focus,
172
- &:focus-visible,
173
- &:focus-within {
174
- .o-select__input {
175
- box-shadow: 0 0 0 0.25rem var(--#{$prefix}focus);
176
- outline: none;
177
- }
178
- }
179
172
  }
@@ -1,116 +1,132 @@
1
- @use "sass:list";
1
+ @use "sass:map";
2
+ @use "../utils/helpers" as h;
3
+ @use "../utils/variables" as vars;
2
4
 
3
5
  /* @docs */
4
- $sidebar-overlay: hsla(0, 0%, 4%, 0.86) !default;
5
- $sidebar-box-shadow: 5px 0px 13px 3px rgba(var(--#{$prefix}black), 0.1) !default;
6
- $sidebar-content-background-color: var(--#{$prefix}grey-lighter) !default;
7
- $sidebar-border-radius: var(--#{$prefix}base-border-radius) !default;
8
- $sidebar-border-width: 1px !default;
9
- $sidebar-border-color: rgba(0, 0, 0, 0.175) !default;
10
- $sidebar-reduced-width: 80px !default;
11
- $sidebar-width: 260px !default;
12
- $sidebar-zindex: 100 !default;
6
+ $sidebar-zindex: map.get(vars.$zindex, "fixed") !default;
7
+
8
+ $sidebar-overlay-background-color: h.useVar(
9
+ "overlay-background-color"
10
+ ) !default;
11
+ $sidebar-overlay-zindex: map.get(vars.$zindex, "overlay") !default;
12
+
13
+ $sidebar-content-zindex: map.get(vars.$zindex, "sidebar") !default;
14
+ $sidebar-content-max-width: 50vw !default;
15
+ $sidebar-content-max-height: 50vh !default;
16
+ $sidebar-content-box-shadow: h.useVar("overlay-box-shadow") !default;
17
+ $sidebar-content-background-color: h.useVar(
18
+ "control-brackground-color"
19
+ ) !default;
20
+ $sidebar-content-border-radius: h.useVar("border-radius") !default;
21
+ $sidebar-content-border-width: h.useVar("control-border-width") !default;
22
+ $sidebar-content-border-style: solid !default;
23
+ $sidebar-content-border-color: h.useVar("control-border-color") !default;
13
24
  /* @docs */
14
25
 
15
26
  .o-sidebar {
27
+ @include h.defineVar("sidebar-zindex", $sidebar-zindex);
28
+ @include h.defineVar(
29
+ "sidebar-overlay-background-color",
30
+ $sidebar-overlay-background-color
31
+ );
32
+ @include h.defineVar("sidebar-overlay-zindex", $sidebar-overlay-zindex);
33
+
34
+ @include h.defineVar("sidebar-content-zindex", $sidebar-content-zindex);
35
+ @include h.defineVar(
36
+ "sidebar-content-box-shadow",
37
+ $sidebar-content-box-shadow
38
+ );
39
+ @include h.defineVar(
40
+ "sidebar-content-background-color",
41
+ $sidebar-content-background-color
42
+ );
43
+ @include h.defineVar(
44
+ "sidebar-content-border-radius",
45
+ $sidebar-content-border-radius
46
+ );
47
+ @include h.defineVar(
48
+ "sidebar-content-border-width",
49
+ $sidebar-content-border-width
50
+ );
51
+ @include h.defineVar(
52
+ "sidebar-content-border-style",
53
+ $sidebar-content-border-style
54
+ );
55
+ @include h.defineVar(
56
+ "sidebar-content-border-color",
57
+ $sidebar-content-border-color
58
+ );
59
+
60
+ display: flex;
61
+ flex-direction: column;
62
+ justify-content: center;
63
+ align-items: center;
64
+ overflow: hidden;
65
+
66
+ // disable clickable
67
+ pointer-events: none;
68
+
16
69
  position: fixed;
17
- top: 0;
70
+ bottom: 0;
18
71
  left: 0;
72
+ right: 0;
73
+ top: 0;
19
74
  height: 100%;
20
75
  width: 100%;
21
- display: none;
76
+ z-index: h.useVar("sidebar-zindex");
77
+
78
+ &__overlay {
79
+ pointer-events: auto;
80
+ position: absolute;
81
+ bottom: 0;
82
+ left: 0;
83
+ right: 0;
84
+ top: 0;
85
+ background-color: h.useVar("sidebar-overlay-background-color");
86
+ z-index: h.useVar("sidebar-overlay-zindex");
87
+ }
22
88
 
23
89
  &__content {
90
+ pointer-events: auto;
24
91
  position: absolute;
25
- background-color: var(
26
- --#{$prefix}sidebar-content-background-color,
27
- $sidebar-content-background-color
28
- );
29
- border-radius: var(
30
- --#{$prefix}sidebar-border-radius,
31
- $sidebar-border-radius
32
- );
33
- box-shadow: var(--#{$prefix}sidebar-box-shadow, $sidebar-box-shadow);
34
-
35
- @each $name, $pair in $colors {
36
- $color: list.nth($pair, 1);
37
- &--#{$name} {
38
- background-color: var(--#{$prefix}variant-#{$name}), $color;
39
- }
40
- }
92
+ overflow: auto;
93
+ z-index: h.useVar("sidebar-content-zindex");
41
94
 
42
- // position
43
- &--right,
44
- &--left {
45
- transition: width var(--#{$prefix}transition-duration)
46
- var(--#{$prefix}transition-timing);
47
- width: var(--#{$prefix}sidebar-width, $sidebar-width);
48
- }
95
+ background-color: h.useVar("sidebar-content-background-color");
96
+ border-width: 0;
97
+ border-style: h.useVar("sidebar-content-border-style");
98
+ border-color: h.useVar("sidebar-content-border-color");
99
+ border-radius: h.useVar("sidebar-content-border-radius");
49
100
 
50
- &--top,
51
- &--bottom {
52
- transition: height var(--#{$prefix}transition-duration)
53
- var(--#{$prefix}transition-timing);
54
- height: var(--#{$prefix}sidebar-width, $sidebar-width);
55
- }
101
+ box-shadow: h.useVar("sidebar-content-box-shadow");
102
+
103
+ transition:
104
+ width h.useVar("transition-duration") h.useVar("transition-timing"),
105
+ height h.useVar("transition-duration") h.useVar("transition-timing");
56
106
 
107
+ // position
57
108
  &--right {
58
109
  left: auto;
59
110
  right: 0;
60
- border-left: var(
61
- --#{$prefix}sidebar-border-width,
62
- $sidebar-border-width
63
- )
64
- solid
65
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
111
+ border-left-width: h.useVar("sidebar-content-border-width");
66
112
  }
67
113
 
68
114
  &--left {
69
115
  left: 0;
70
116
  right: auto;
71
- border-right: var(
72
- --#{$prefix}sidebar-border-width,
73
- $sidebar-border-width
74
- )
75
- solid
76
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
117
+ border-right-width: h.useVar("sidebar-content-border-width");
77
118
  }
78
119
 
79
120
  &--top {
80
121
  top: 0;
81
122
  bottom: auto;
82
- border-bottom: var(
83
- --#{$prefix}sidebar-border-width,
84
- $sidebar-border-width
85
- )
86
- solid
87
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
123
+ border-bottom-width: h.useVar("sidebar-content-border-width");
88
124
  }
89
125
 
90
126
  &--bottom {
91
127
  top: auto;
92
128
  bottom: 0;
93
- border-top: var(
94
- --#{$prefix}sidebar-border-width,
95
- $sidebar-border-width
96
- )
97
- solid
98
- var(--#{$prefix}sidebar-border-color, $sidebar-border-color);
99
- }
100
-
101
- &--reduced {
102
- width: var(
103
- --#{$prefix}sidebar-reduced-width,
104
- $sidebar-reduced-width
105
- );
106
- }
107
-
108
- &--hover-expand {
109
- &:hover {
110
- transition: width var(--#{$prefix}transition-duration)
111
- var(--#{$prefix}transition-timing);
112
- width: var(--#{$prefix}sidebar-width, $sidebar-width);
113
- }
129
+ border-top-width: h.useVar("sidebar-content-border-width");
114
130
  }
115
131
 
116
132
  &--fullwidth {
@@ -124,32 +140,17 @@ $sidebar-zindex: 100 !default;
124
140
  }
125
141
  }
126
142
 
127
- &__overlay {
128
- position: absolute;
129
- bottom: 0;
130
- left: 0;
131
- right: 0;
132
- top: 0;
133
- background: var(--#{$prefix}sidebar-overlay, $sidebar-overlay);
134
- }
135
-
136
- &--active {
137
- display: block;
138
- }
139
-
140
143
  &--inline {
141
- position: relative;
144
+ @include h.defineVar("sidebar-zindex", "unset");
145
+ @include h.defineVar("sidebar-content-zindex", "unset");
142
146
 
143
- .o-sidebar__overlay {
144
- position: absolute;
145
- }
147
+ position: relative;
146
148
 
147
149
  .o-sidebar__content {
148
150
  position: relative;
151
+ border-width: 0;
152
+ width: 100%;
153
+ height: 100%;
149
154
  }
150
155
  }
151
-
152
- &:not(&--inline) {
153
- z-index: var(--#{$prefix}sidebar-zindex, $sidebar-zindex);
154
- }
155
156
  }
@@ -1,34 +1,42 @@
1
+ @use "../utils/helpers" as h;
2
+ @use "../utils/variables" as vars;
3
+
1
4
  /* @docs */
5
+ $skeleton-spacer: 0.5em !default;
6
+ $skeleton-duration: 1.5s !default;
7
+ $skeleton-font-size: h.useVar("font-size") !default;
8
+ $skeleton-background-color: vars.$grey-lighter !default;
2
9
  $skeleton-background: linear-gradient(
3
10
  90deg,
4
- $grey-lighter 25%,
5
- rgba($grey-lighter, 0.5) 50%,
6
- $grey-lighter 75%
11
+ $skeleton-background-color 25%,
12
+ rgba($skeleton-background-color, 0.5) 50%,
13
+ $skeleton-background-color 75%
7
14
  ) !default;
8
- $skeleton-border-radius: var(--#{$prefix}base-border-radius) !default;
9
- $skeleton-duration: 1.5s !default;
10
- $skeleton-margin: 0.5rem 0 0 0 !default;
15
+ $skeleton-border-radius: h.useVar("border-radius") !default;
16
+ $skeleton-border-radius-rounded: h.useVar("border-radius-rounded") !default;
11
17
  /* @docs */
12
18
 
13
- @keyframes skeleton-loading {
14
- 0% {
15
- background-position: 100% 50%;
16
- }
19
+ .o-skeleton {
20
+ @include h.defineVar("skeleton-duration", $skeleton-duration);
21
+ @include h.defineVar("skeleton-spacer", $skeleton-spacer);
22
+ @include h.defineVar("skeleton-font-size", $skeleton-font-size);
23
+ @include h.defineVar("skeleton-background", $skeleton-background);
24
+ @include h.defineVar("skeleton-border-radius", $skeleton-border-radius);
25
+ @include h.defineVar(
26
+ "skeleton-border-radius-rounded",
27
+ $skeleton-border-radius-rounded
28
+ );
17
29
 
18
- 100% {
19
- background-position: 0 50%;
20
- }
21
- }
30
+ @keyframes skeleton-loading {
31
+ 0% {
32
+ background-position: 100% 50%;
33
+ }
22
34
 
23
- @mixin steps-size($size, $name: null) {
24
- @if $name {
25
- line-height: var(--#{$prefix}skeleton-font-size-#{$name}, $size);
26
- } @else {
27
- line-height: var(--#{$prefix}skeleton-font-size, $size);
35
+ 100% {
36
+ background-position: 0 50%;
37
+ }
28
38
  }
29
- }
30
39
 
31
- .o-skeleton {
32
40
  display: inline-flex;
33
41
  flex-direction: column;
34
42
  vertical-align: middle;
@@ -36,21 +44,14 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
36
44
 
37
45
  &__item {
38
46
  width: 100%;
39
- background: var(--#{$prefix}skeleton-background, $skeleton-background);
40
- margin: var(--#{$prefix}skeleton-margin, $skeleton-margin);
41
-
42
- @include steps-size($base-font-size);
43
-
44
- @each $name, $value in $sizes {
45
- &--#{$name} {
46
- @include steps-size($value, $name);
47
- }
48
- }
47
+ background: h.useVar("skeleton-background");
48
+ line-height: h.useVar("skeleton-font-size");
49
+ border-radius: h.useVar("skeleton-border-radius");
49
50
 
50
51
  &--rounded {
51
- border-radius: var(
52
- --#{$prefix}skeleton-border-radius,
53
- $skeleton-border-radius
52
+ @include h.defineVar(
53
+ "skeleton-border-radius",
54
+ h.useVar("skeleton-border-radius-rounded")
54
55
  );
55
56
  }
56
57
 
@@ -58,15 +59,26 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
58
59
  background-size: 400% 100%;
59
60
  animation-name: skeleton-loading;
60
61
  animation-iteration-count: infinite;
61
- animation-duration: var(
62
- --#{$prefix}skeleton-duration,
63
- $skeleton-duration
64
- );
62
+ animation-duration: h.useVar("skeleton-duration");
65
63
  }
66
64
 
67
65
  &::after {
68
66
  content: "\00a0";
69
67
  }
68
+
69
+ // size variants
70
+ @each $name, $value in vars.$sizes {
71
+ &--#{$name} {
72
+ @include h.defineVar(
73
+ "skeleton-font-size",
74
+ h.useVar("size-#{$name}")
75
+ );
76
+ }
77
+ }
78
+
79
+ & + .o-skeleton__item {
80
+ margin-top: h.useVar("skeleton-spacer");
81
+ }
70
82
  }
71
83
 
72
84
  &--centered {
@@ -75,6 +87,5 @@ $skeleton-margin: 0.5rem 0 0 0 !default;
75
87
 
76
88
  &--right {
77
89
  align-items: flex-end;
78
- margin: var(--#{$prefix}skeleton-margin, $skeleton-margin);
79
90
  }
80
91
  }