@oruga-ui/theme-oruga 0.5.0 → 0.6.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 (39) hide show
  1. package/README.md +4 -3
  2. package/dist/oruga.css +2 -2
  3. package/dist/scss/components/_autocomplete.scss +15 -15
  4. package/dist/scss/components/_button.scss +175 -162
  5. package/dist/scss/components/_carousel.scss +199 -177
  6. package/dist/scss/components/_checkbox.scss +130 -122
  7. package/dist/scss/components/_collapse.scss +11 -9
  8. package/dist/scss/components/_datepicker.scss +408 -416
  9. package/dist/scss/components/_datetimepicker.scss +8 -8
  10. package/dist/scss/components/_dropdown.scss +224 -206
  11. package/dist/scss/components/_field.scss +107 -106
  12. package/dist/scss/components/_icon.scss +44 -40
  13. package/dist/scss/components/_input.scss +127 -112
  14. package/dist/scss/components/_loading.scss +27 -24
  15. package/dist/scss/components/_menu.scss +100 -63
  16. package/dist/scss/components/_modal.scss +66 -66
  17. package/dist/scss/components/_notification.scss +146 -134
  18. package/dist/scss/components/_pagination.scss +227 -198
  19. package/dist/scss/components/_radio.scss +95 -74
  20. package/dist/scss/components/_select.scss +143 -120
  21. package/dist/scss/components/_sidebar.scss +120 -104
  22. package/dist/scss/components/_skeleton.scss +55 -55
  23. package/dist/scss/components/_slider.scss +166 -156
  24. package/dist/scss/components/_steps.scss +300 -287
  25. package/dist/scss/components/_switch.scss +115 -128
  26. package/dist/scss/components/_table.scss +363 -330
  27. package/dist/scss/components/_tabs.scss +295 -280
  28. package/dist/scss/components/_taginput.scss +95 -93
  29. package/dist/scss/components/_timepicker.scss +74 -68
  30. package/dist/scss/components/_tooltip.scss +522 -424
  31. package/dist/scss/components/_upload.scss +51 -48
  32. package/dist/scss/oruga.scss +0 -1
  33. package/dist/scss/utils/_animations.scss +97 -97
  34. package/dist/scss/utils/_base.scss +31 -14
  35. package/dist/scss/utils/_helpers.scss +65 -65
  36. package/dist/scss/utils/_root.scss +37 -44
  37. package/dist/scss/utils/_variables.scss +44 -44
  38. package/dist/theme.js +1 -1
  39. package/package.json +26 -25
@@ -1,150 +1,137 @@
1
1
  @use "sass:list";
2
+ @use "sass:color";
2
3
 
3
4
  /* @docs */
4
- $switch-active-background-color: var(--#{$prefix}primary) !default;
5
- $switch-action-background: #f5f5f5 !default;
5
+ $switch-spacer: 0.5em !default;
6
+ $switch-width: 2.75em !default;
7
+ $switch-height: 1.5em !default;
6
8
  $switch-background: var(--#{$prefix}grey-light) !default;
9
+ $switch-toggle-background: #f5f5f5 !default;
10
+ $switch-border: $control-border-width solid var(--#{$prefix}grey-lighter) !default;
7
11
  $switch-border-radius: var(--#{$prefix}base-border-radius) !default;
8
- $switch-box-shadow:
9
- 0 3px 1px 0 rgba(0, 0, 0, 0.05),
10
- 0 2px 2px 0 rgba(0, 0, 0, 0.1),
11
- 0 3px 3px 0 rgba(0, 0, 0, 0.05) !default;
12
- $switch-disabled-opacity: var(--#{$prefix}base-disabled-opacity) !default;
13
- $switch-margin-label: 0.5em !default;
14
- $switch-padding: 0.2em !default;
15
- $switch-rounded-border-radius: var(
16
- --#{$prefix}base-border-radius-rounded
12
+ $switch-border-radius-rounded: var(
13
+ --#{$prefix}base-border-radius-rounded
17
14
  ) !default;
18
- $switch-width: 2.75 * 1em !default;
15
+ $switch-checked-background: var(--#{$prefix}primary) !default;
16
+ $switch-disabled-opacity: var(--#{$prefix}base-disabled-opacity) !default;
19
17
  /* @docs */
20
18
 
19
+ @function switchSVG($color) {
20
+ $svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#{$color}'/></svg>";
21
+
22
+ @return svg-encode($svg);
23
+ }
24
+
21
25
  .o-switch {
22
- @include unselectable;
23
- cursor: pointer;
24
- display: inline-flex;
25
- align-items: center;
26
- position: relative;
27
- border-radius: 50rem;
28
-
29
- // size variants
30
- @each $name, $value in $sizes {
31
- &--#{$name} {
32
- font-size: var(--#{$prefix}font-size-#{name}, $value);
33
- }
34
- }
26
+ @include unselectable;
35
27
 
36
- // color variants
37
- @each $name, $pair in $colors {
38
- $color: list.nth($pair, 1);
28
+ cursor: pointer;
29
+ display: block;
30
+ align-items: center;
31
+ position: relative;
32
+
33
+ &__input {
34
+ flex-shrink: 0;
35
+ width: var(--#{$prefix}switch-width, $switch-width);
36
+ height: var(--#{$prefix}switch-height, $switch-height);
37
+ margin-top: 0.25em;
38
+ vertical-align: top;
39
+ cursor: pointer;
40
+ -webkit-appearance: none;
41
+ -moz-appearance: none;
42
+ appearance: none;
43
+ background-color: var(
44
+ --#{$prefix}switch-background,
45
+ $switch-background
46
+ );
47
+ background-image: url(switchSVG($switch-toggle-background));
48
+ background-position: left center;
49
+ background-repeat: no-repeat;
50
+ background-size: contain;
51
+ border: var(--#{$prefix}switch-border, $switch-border);
52
+ border-radius: var(
53
+ --#{$prefix}switch-border-radius,
54
+ $switch-border-radius
55
+ );
56
+ -webkit-print-color-adjust: exact;
57
+ print-color-adjust: exact;
58
+ transition: background-position var(--#{$prefix}transition-duration)
59
+ var(--#{$prefix}transition-timing);
60
+
61
+ &:checked {
62
+ background-position: right center;
63
+ background-color: var(
64
+ --#{$prefix}switch-checked-background,
65
+ $switch-checked-background
66
+ );
67
+ }
68
+ }
39
69
 
40
- &--#{$name} {
41
- --#{$prefix}focus: #{createFocus($color)};
70
+ // size variants
71
+ @each $name, $value in $sizes {
72
+ &--#{$name} {
73
+ font-size: var(--#{$prefix}font-size-#{name}, $value);
74
+ }
75
+ }
42
76
 
43
- .o-switch__check--checked {
44
- background: var(--#{$prefix}variant-#{$name}, $color);
45
- }
77
+ // color variants
78
+ @each $name, $pair in $colors {
79
+ $color: list.nth($pair, 1);
80
+ &--#{$name} {
81
+ --#{$prefix}focus: #{createFocus($color)};
82
+
83
+ input:checked {
84
+ border-color: var(--#{$prefix}#{$name});
85
+ background-color: var(--#{$prefix}variant-#{$name}, $color);
86
+ }
87
+ }
88
+
89
+ // possive variant
90
+ &--#{$name}-passive {
91
+ --#{$prefix}focus: #{createFocus($color)};
92
+
93
+ input {
94
+ background-color: var(--#{$prefix}#{$name});
95
+ border-color: var(--#{$prefix}#{$name});
96
+ }
97
+ }
46
98
  }
47
- &--#{$name}-passive {
48
- --#{$prefix}focus: #{createFocus($color)};
49
99
 
50
- .o-switch__check:not(.o-switch__check--checked) {
51
- background: var(--#{$prefix}variant-#{$name}, $color);
52
- }
100
+ &__label {
101
+ margin-left: var(--#{$prefix}switch-spacer, $switch-spacer);
53
102
  }
54
- }
55
103
 
56
- &__label {
57
- margin-left: var(--#{$prefix}switch-margin-label, $switch-margin-label);
58
- }
104
+ &--left {
105
+ display: inline-flex;
106
+ flex-direction: row-reverse;
59
107
 
60
- &--left {
61
- flex-direction: row-reverse;
108
+ .o-switch__label {
109
+ margin-left: 0;
110
+ margin-right: var(--#{$prefix}switch-spacer, $switch-spacer);
111
+ }
112
+ }
62
113
 
63
- .o-switch__label {
64
- margin-left: 0;
65
- margin-right: var(--#{$prefix}switch-margin-label, $switch-margin-label);
114
+ &--rounded .o-switch__input {
115
+ border-radius: var(
116
+ --#{$prefix}switch-border-radius-rounded,
117
+ $switch-border-radius-rounded
118
+ );
66
119
  }
67
- }
68
120
 
69
- &__check-switch {
70
- content: "";
71
- display: block;
72
- height: calc(
73
- (
74
- var(--#{$prefix}switch-width, $switch-width) - var(
75
- --#{$prefix}switch-padding,
76
- $switch-padding
77
- ) * 2
78
- ) * 0.5
79
- );
80
- width: calc(
81
- (
82
- var(--#{$prefix}switch-width, $switch-width) - var(
83
- --#{$prefix}switch-padding,
84
- $switch-padding
85
- ) * 2
86
- ) * 0.5
87
- );
88
- background: var(
89
- --#{$prefix}switch-action-background,
90
- $switch-action-background
91
- );
92
- box-shadow: var(--#{$prefix}switch-box-shadow, $switch-box-shadow);
93
- transition: transform var(--#{$prefix}transition-duration)
94
- var(--#{$prefix}transition-timing);
95
- will-change: transform;
96
- transform-origin: left;
97
- }
98
-
99
- &__check {
100
- display: flex;
101
- align-items: center;
102
- flex-shrink: 0;
103
- width: var(--#{$prefix}switch-width, $switch-width);
104
- height: calc(
105
- var(--#{$prefix}switch-width, $switch-width) * 0.5 +
106
- var(--#{$prefix}switch-padding, $switch-padding)
107
- );
108
-
109
- padding: var(--#{$prefix}switch-padding, $switch-padding);
110
- background: var(--#{$prefix}switch-background, $switch-background);
111
- border-radius: var(--#{$prefix}switch-border-radius, $switch-border-radius);
112
- transition: background var(--#{$prefix}transition-duration)
113
- var(--#{$prefix}transition-timing);
114
-
115
- &--checked {
116
- background: var(
117
- --#{$prefix}switch-active-background-color,
118
- $switch-active-background-color
119
- );
120
-
121
- .o-switch__check-switch {
122
- transform: translate3d(100%, 0, 0);
123
- }
121
+ &--disabled {
122
+ opacity: var(
123
+ --#{$prefix}switch-disabled-opacity,
124
+ $switch-disabled-opacity
125
+ );
126
+ }
127
+
128
+ // focus effect
129
+ &:focus,
130
+ &:focus-visible,
131
+ &:focus-within {
132
+ .o-switch__input {
133
+ box-shadow: 0 0 0 0.25rem var(--#{$prefix}focus);
134
+ outline: none;
135
+ }
124
136
  }
125
- }
126
-
127
- &__input {
128
- position: absolute;
129
- left: 0;
130
- opacity: 0;
131
- z-index: -1;
132
- }
133
-
134
- &--rounded {
135
- border-radius: var(
136
- --#{$prefix}switch-rounded-border-radius,
137
- $switch-rounded-border-radius
138
- );
139
- }
140
-
141
- &--disabled {
142
- opacity: var(--#{$prefix}switch-disabled-opacity, $switch-disabled-opacity);
143
- }
144
-
145
- // focus effect
146
- &:focus &__check,
147
- &:focus-within &__check {
148
- box-shadow: 0 0 0 0.25rem var(--#{$prefix}focus);
149
- }
150
137
  }