@castlabs/ui 7.5.0 → 7.5.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castlabs/ui",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "repository": "https://github.com/castlabs/ui-styleguide",
5
5
  "private": false,
6
6
  "description": "A vanilla HTML/CS/JS & Vue.js component library for Castlabs.",
@@ -23,9 +23,9 @@
23
23
 
24
24
  &:disabled,
25
25
  &.disabled {
26
- background-color: var(--cl-color-disabled-background);
27
- border-color: var(--cl-color-disabled-border);
28
- color: var(--cl-color-disabled-text);
26
+ background-color: var(--cl-color-disabled-background) !important;
27
+ border-color: var(--cl-color-disabled-border) !important;
28
+ color: var(--cl-color-disabled-text) !important;
29
29
  cursor: not-allowed;
30
30
  opacity: 1 !important; // sass-lint:disable-line no-important
31
31
  pointer-events: initial;
@@ -60,14 +60,20 @@ a.btn {
60
60
 
61
61
  background-color: transparent;
62
62
  border: 0;
63
+ color: var(--cl-color-text);
63
64
  font-weight: 500;
64
65
  line-height: 1;
65
66
  margin-left: $spacing-tiny;
66
67
  min-width: 0;
67
68
  padding: 0;
68
69
 
69
- &:not(:hover) {
70
- color: $color-ci-steel;
70
+ &:not(:hover, [class*='cl-color-']) {
71
+ #{'--cl-color-text'}: $color-ci-steel;
72
+ }
73
+
74
+ &.disabled,
75
+ &:disabled {
76
+ visibility: hidden;
71
77
  }
72
78
  }
73
79
 
@@ -21,7 +21,7 @@ $cl-url-postfix: '' !default;
21
21
  @extend %form-field-box;
22
22
  @extend %form-field-typography-monospace;
23
23
 
24
- @include cl-form-focus;
24
+ @include cl-form-focus(true);
25
25
 
26
26
  background-image: url('#{$cl-url-prefix}select.svg#{$cl-url-postfix}'), none, none;
27
27
  display: block;
@@ -10,10 +10,6 @@
10
10
  .cl-section-main-side {
11
11
  padding-top: 0;
12
12
 
13
- // .cl-section-primary + & { // first one right below header
14
- // padding-top: $spacing-small;
15
- // }
16
-
17
13
  .row > [class^='col-'] {
18
14
  margin-top: $spacing-small * 2;
19
15
  }
@@ -14,46 +14,6 @@ main a {
14
14
  @extend %cl-a;
15
15
  }
16
16
 
17
- // .cl-a-primary a:not(.btn),
18
- // .cl-a-secondary a.cl-a-primary:not(.btn),
19
- // .cl-a-text a.cl-a-primary:not(.btn),
20
- // .cl-a-transparent a.cl-a-primary:not(.btn),
21
- // a.cl-a-primary:not(.btn) {
22
- // @extend %cl-a-primary;
23
- // }
24
- //
25
- // .cl-a-secondary a:not(.btn),
26
- // .cl-a-primary a.cl-a-secondary:not(.btn),
27
- // .cl-a-text a.cl-a-secondary:not(.btn),
28
- // .cl-a-transparent a.cl-a-secondary:not(.btn),
29
- // a.cl-a-secondary:not(.btn) {
30
- // @extend %cl-a-secondary;
31
- // }
32
-
33
- // .cl-a-text a:not(.btn),
34
- // .cl-a-primary a.cl-a-text:not(.btn),
35
- // .cl-a-secondary a.cl-a-text:not(.btn),
36
- // .cl-a-transparent a.cl-a-text:not(.btn),
37
- // a.cl-a-text:not(.btn) {
38
- // @extend %cl-a-text;
39
- // }
40
-
41
- // .cl-a-transparent a:not(.btn),
42
- // .cl-a-primary a.cl-a-transparent:not(.btn),
43
- // .cl-a-secondary a.cl-a-transparent:not(.btn),
44
- // .cl-a-text a.cl-a-transparent:not(.btn),
45
- // a.cl-a-transparent:not(.btn) {
46
- // @extend %cl-a-transparent;
47
- // }
48
-
49
- // .cl-a-none a:not(.btn),
50
- // .cl-a-primary a.cl-a-none:not(.btn),
51
- // .cl-a-secondary a.cl-a-none:not(.btn),
52
- // .cl-a-text a.cl-a-none:not(.btn),
53
- // a.cl-a-none:not(.btn) {
54
- // @extend %cl-a-none;
55
- // }
56
-
57
17
  .cl-a-btn {
58
18
  // a link that is more an embedded button, e.g. in table actions
59
19
  @extend %cl-a-btn;
@@ -70,11 +30,17 @@ main a {
70
30
 
71
31
  background-color: transparent;
72
32
  border-radius: 0;
33
+ color: var(--cl-color-text);
73
34
  margin-left: $spacing-tiny;
74
35
  text-decoration: none;
75
36
 
76
- &:not(:hover) {
77
- color: $color-ci-steel;
37
+ &:not(:hover, [class*='cl-color-']) {
38
+ #{'--cl-color-text'}: $color-ci-steel;
39
+ }
40
+
41
+ &.disabled,
42
+ &:disabled {
43
+ visibility: hidden;
78
44
  }
79
45
  }
80
46
 
@@ -68,9 +68,10 @@
68
68
  &.active,
69
69
  .show > &.dropdown-toggle {
70
70
  // .dropdown-toggle is for topnav
71
- background-color: var(--cl-color-text);
72
- border-color: var(--cl-color-background);
73
- color: var(--cl-color-background);
71
+ background-color: var(--cl-color-background) !important;
72
+ border-color: var(--cl-color-border) !important;
73
+ color: var(--cl-color-text) !important;
74
+ opacity: var(--cl-opacity-active);
74
75
 
75
76
  &.cl-color-transparent {
76
77
  background-color: $color-ci-eggshell;
@@ -53,6 +53,7 @@ $color-background: $color-ci-white;
53
53
  $color-code-background: rgb(16 0 0 / 5%); // transparent to work on different colors
54
54
 
55
55
  $color-line: $color-ci-clay;
56
+ $color-opacity-active: 0.8;
56
57
 
57
58
  @mixin cl-color-focus-outline-raw($color: var(--cl-color-focus), $offset: -3px) {
58
59
  box-shadow: none; // disable BS outlines
@@ -181,6 +182,7 @@ $color-line: $color-ci-clay;
181
182
  #{'--cl-color-disabled-background'}: $color-disabled;
182
183
  #{'--cl-color-disabled-border'}: $color-disabled;
183
184
  #{'--cl-color-disabled-text'}: $color-ci-eggshell;
185
+ #{'--cl-opacity-active'}: $color-opacity-active;
184
186
  }
185
187
 
186
188
  %cl-color-night-outline {
@@ -196,6 +198,7 @@ $color-line: $color-ci-clay;
196
198
  #{'--cl-color-disabled-background'}: transparent;
197
199
  #{'--cl-color-disabled-border'}: $color-disabled;
198
200
  #{'--cl-color-disabled-text'}: $color-disabled;
201
+ #{'--cl-opacity-active'}: $color-opacity-active * 0.9;
199
202
  }
200
203
 
201
204
  %cl-color-text-light {
@@ -223,6 +226,7 @@ $color-line: $color-ci-clay;
223
226
 
224
227
  #{'--cl-color-background'}: $color-ci-red;
225
228
  #{'--cl-color-border'}: $color-ci-red;
229
+ #{'--cl-opacity-active'}: $color-opacity-active;
226
230
  }
227
231
 
228
232
  %cl-color-red-outline {
@@ -344,6 +348,10 @@ $color-line: $color-ci-clay;
344
348
 
345
349
  #{'--cl-color-background'}: transparent;
346
350
  #{'--cl-color-border'}: $color-ci-eggshell;
351
+ #{'--cl-color-disabled-background'}: transparent;
352
+ #{'--cl-color-disabled-border'}: $color-disabled;
353
+ #{'--cl-color-disabled-text'}: $color-disabled;
354
+ #{'--cl-opacity-active'}: $color-opacity-active * 0.9;
347
355
  }
348
356
 
349
357
  %cl-color-disabled {
@@ -374,4 +382,7 @@ $color-line: $color-ci-clay;
374
382
  #{'--cl-color-highlight'}: rgba(#fff, 0.1);
375
383
  #{'--cl-color-link'}: $color-ci-eggshell;
376
384
  #{'--cl-color-focus'}: $color-ci-eggshell;
385
+ #{'--cl-color-disabled-background'}: transparent;
386
+ #{'--cl-color-disabled-border'}: transparent;
387
+ #{'--cl-color-disabled-text'}: $color-disabled;
377
388
  }
@@ -39,7 +39,8 @@ $form-spacing-label-input: px(2);
39
39
  $typography-sans-font-list,
40
40
  400,
41
41
  $form-field-fontsize,
42
- $form-field-line-height
42
+ $form-field-line-height,
43
+ 0
43
44
  );
44
45
  }
45
46
 
@@ -49,7 +50,7 @@ $form-spacing-label-input: px(2);
49
50
  400,
50
51
  $form-field-fontsize,
51
52
  $form-field-line-height,
52
- 0.025em
53
+ 0
53
54
  );
54
55
  }
55
56
 
@@ -65,10 +66,19 @@ $form-spacing-label-input: px(2);
65
66
  }
66
67
  }
67
68
 
68
- @mixin cl-form-focus {
69
+ @mixin cl-form-focus($focus: false) {
69
70
  &:focus-visible,
70
71
  &:focus-visible:first-child,
71
72
  &:focus-visible:last-child {
72
73
  @include cl-form-focus-embed;
73
74
  }
75
+
76
+ @if $focus == true {
77
+ // sometimes we need to undo Bootstrap too
78
+ &:focus,
79
+ &:focus:first-child,
80
+ &:focus:last-child {
81
+ @include cl-form-focus-embed;
82
+ }
83
+ }
74
84
  }
@@ -75,7 +75,7 @@ $typography-monospace-line-height: 1.375;
75
75
  }
76
76
 
77
77
  @mixin typography-link(
78
- $color: inherit,
78
+ $color: var(--cl-color-text),
79
79
  $color-hover: var(--cl-color-hover),
80
80
  $color-underline: var(--cl-color-link),
81
81
  $color-underline-hover: $color-hover
@@ -146,6 +146,14 @@ $typography-monospace-line-height: 1.375;
146
146
  background-color: transparent;
147
147
  color: var(--cl-color-hover);
148
148
  }
149
+
150
+ &.disabled,
151
+ &:disabled {
152
+ background-color: transparent;
153
+ color: var(--cl-color-text);
154
+ cursor: text;
155
+ text-decoration: none;
156
+ }
149
157
  }
150
158
 
151
159
  %cl-a {
@@ -86,6 +86,26 @@
86
86
  @extend %cl-color-none;
87
87
  }
88
88
 
89
+ .cl-color-red,
90
+ .cl-color-sky,
91
+ .cl-color-ash,
92
+ .cl-color-petrol,
93
+ .cl-color-berry,
94
+ .cl-color-black,
95
+ .cl-color-text,
96
+ .cl-color-dark,
97
+ .cl-color-night {
98
+ // on dark backgrounds secondary buttons need to be light
99
+ .cl-color-secondary {
100
+ @extend %cl-color-eggshell;
101
+ }
102
+
103
+ // on dark backgrounds secondary buttons need to be outlined
104
+ .cl-color-tertiary {
105
+ @extend %cl-color-transparent;
106
+ }
107
+ }
108
+
89
109
  // ----------------------------------------------
90
110
 
91
111
  a,
@@ -99,10 +119,12 @@ div {
99
119
 
100
120
  .cl-color-text-red {
101
121
  #{'--cl-color-text'}: $color-ci-red;
122
+ #{'--cl-color-link'}: $color-ci-red;
102
123
  }
103
124
 
104
125
  .cl-color-text-sky {
105
126
  #{'--cl-color-text'}: $color-ci-sky;
127
+ #{'--cl-color-link'}: $color-ci-sky;
106
128
  }
107
129
 
108
130
  .cl-color-text-night {
@@ -121,40 +143,50 @@ div {
121
143
 
122
144
  .cl-color-text-ash {
123
145
  #{'--cl-color-text'}: $color-ci-ash;
146
+ #{'--cl-color-link'}: $color-ci-ash;
124
147
  }
125
148
 
126
149
  .cl-color-text-petrol {
127
150
  #{'--cl-color-text'}: $color-ci-petrol;
151
+ #{'--cl-color-link'}: $color-ci-petrol;
128
152
  }
129
153
 
130
154
  .cl-color-text-berry {
131
155
  #{'--cl-color-text'}: $color-ci-berry;
156
+ #{'--cl-color-link'}: $color-ci-berry;
132
157
  }
133
158
 
134
159
  .cl-color-text-none {
135
160
  #{'--cl-color-text'}: transparent;
161
+ #{'--cl-color-link'}: transparent;
136
162
  }
137
163
 
138
164
  .cl-color-text-brick {
139
165
  #{'--cl-color-text'}: $color-ci-brick;
166
+ #{'--cl-color-link'}: $color-ci-brick;
140
167
  }
141
168
 
142
169
  .cl-color-text-honey {
143
170
  #{'--cl-color-text'}: $color-ci-honey;
171
+ #{'--cl-color-link'}: $color-ci-honey;
144
172
  }
145
173
 
146
174
  .cl-color-text-leaf {
147
175
  #{'--cl-color-text'}: $color-ci-leaf;
176
+ #{'--cl-color-link'}: $color-ci-leaf;
148
177
  }
149
178
 
150
179
  .cl-color-text-sea {
151
180
  #{'--cl-color-text'}: $color-ci-sea;
181
+ #{'--cl-color-link'}: $color-ci-sea;
152
182
  }
153
183
 
154
184
  .cl-color-text-orchid {
155
185
  #{'--cl-color-text'}: $color-ci-orchid;
186
+ #{'--cl-color-link'}: $color-ci-orchid;
156
187
  }
157
188
 
158
189
  .cl-color-text-steel {
159
190
  #{'--cl-color-text'}: $color-ci-steel;
191
+ #{'--cl-color-link'}: $color-ci-steel;
160
192
  }
@@ -74,7 +74,7 @@ h6.cl-faded,
74
74
 
75
75
  @for $i from 0 through 10 {
76
76
  .cl-w-#{$i * 10} {
77
- width: $i * 10;
77
+ width: $i * 10%;
78
78
  }
79
79
  }
80
80
 
@@ -23,17 +23,11 @@
23
23
  &.cl-color-petrol + &.cl-color-petrol,
24
24
  &.cl-color-berry + &.cl-color-berry {
25
25
  @include media-breakpoint-up(sm) {
26
- margin-top: $spacing-small * -3;
26
+ margin-top: $spacing-small * -2.5;
27
27
  }
28
28
  }
29
29
  }
30
30
 
31
- // .cl-section:not(.cl-color-red):not(.cl-color-sky):not(.cl-color-night):not(.cl-color-eggshell):not(.cl-color-clay):not(.cl-color-ash):not(.cl-color-petrol):not(.cl-color-berry) + .cl-section:not(.cl-color-red):not(.cl-color-sky):not(.cl-color-night):not(.cl-color-eggshell):not(.cl-color-clay):not(.cl-color-ash):not(.cl-color-petrol):not(.cl-color-berry) {
32
- // @include media-breakpoint-up(sm) {
33
- // margin-top: $spacing-small * -3;
34
- // }
35
- // }
36
-
37
31
  // pre-2005 legacy mappings
38
32
  .cl-section-regular {
39
33
  @extend %section-padding;