barbican-reset 1.5.1 → 1.5.2

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.
@@ -74,6 +74,7 @@
74
74
  border: $border solid $color;
75
75
  background-color: $color;
76
76
  color: $background;
77
+ outline: none;
77
78
 
78
79
  svg {
79
80
  fill: $background;
@@ -1,32 +1,39 @@
1
1
  @mixin focus {
2
- &:focus {
3
- box-shadow: none;
4
- outline: none;
5
- }
6
- &:hover, &[data-focus-visible-added] {
2
+ // &:focus { <-- better remove this, but could cause bugs
3
+ // box-shadow: none;
4
+ // outline: none;
5
+ // }
6
+ &:hover, &:focus-visible, &[data-focus-visible-added] {
7
7
  @content;
8
- }
8
+ }
9
9
  }
10
10
 
11
- @mixin double-box($bg: $white, $col: $black, $bg_size: 0.25rem, $col_size: 0.15rem) {
12
- box-shadow: 0 0 0 $bg_size $bg, 0 0 0 ($bg_size + $col_size) $col;
11
+ @mixin box-setup {
13
12
  position: relative;
13
+ outline: none;
14
14
  z-index: 2;
15
15
  }
16
16
 
17
+ @mixin double-box($bg: $white, $col: $black, $bg_size: 0.25rem, $col_size: 0.15rem) {
18
+ @include box-setup;
19
+ box-shadow: 0 0 0 $bg_size $bg, 0 0 0 ($bg_size + $col_size) $col;
20
+ }
21
+
17
22
  @mixin single-box($bg: $white, $size: 0.25rem) {
23
+ @include box-setup;
18
24
  box-shadow: 0 0 0 $size $bg;
19
- position: relative;
20
- z-index: 2;
21
25
  }
22
26
 
23
27
  @mixin link-focus($color: $c-grey-midnight, $border: $white) {
24
28
  @include focus {
25
29
  @include double-box($color, $border);
26
30
  background-color: $color;
27
- position: relative;
28
31
  color: $border;
29
- outline: none;
30
- z-index: 2;
31
32
  }
32
33
  }
34
+
35
+ @mixin input-focus {
36
+ @include single-box($c-grey-steel, 0.0625rem);
37
+ border: 1px solid $c-grey-steel;
38
+ background-color: $c-grey-alpine;
39
+ }
@@ -10,9 +10,3 @@
10
10
  }
11
11
  }
12
12
 
13
- @mixin all-text-inputs {
14
- border: solid $border-width $c-border-strong;
15
- padding: 0.875rem 0.875rem 0.75rem;
16
- background-color: $c-grey-alpine;
17
- border-radius: $border-radius-lg;
18
- }
@@ -0,0 +1,78 @@
1
+
2
+ @mixin all-text-inputs {
3
+ border: solid $border-width $c-border-strong;
4
+ padding: 0.875rem 0.875rem 0.75rem;
5
+ background-color: $c-grey-alpine;
6
+ border-radius: $border-radius-lg;
7
+ }
8
+
9
+ @mixin input-dropdown {
10
+ background-color: $c-grey-alpine;
11
+ border-radius: $border-radius-lg;
12
+ border-color: $c-grey-concrete;
13
+ padding: 0.875rem 0.5rem;
14
+ color: $c-grey-night;
15
+ width: 100%;
16
+ }
17
+
18
+ @mixin focus_colors {
19
+ background-color: $c-status-neutral-fade;
20
+ border: 1px solid $c-status-neutral;
21
+ color: $c-status-neutral;
22
+ }
23
+
24
+ @mixin input-radio($state:neutral) {
25
+ display: inline-block;
26
+ position: relative;
27
+ margin: 0.25rem;
28
+ padding: 0;
29
+
30
+ input[type=radio] {
31
+ $size: 0.875rem;
32
+ position: absolute;
33
+ height: $size;
34
+ margin: auto;
35
+ width: $size;
36
+ right: auto;
37
+ z-index: 3;
38
+ left: 1rem;
39
+ bottom: 0;
40
+ top: 0;
41
+
42
+ @if $state != disabled {
43
+ cursor: pointer;
44
+
45
+ @include focus {
46
+ outline: none;
47
+
48
+ ~ label {
49
+ @include single-box($c-grey-steel, 0.0625rem);
50
+ border: 1px solid $c-grey-steel;
51
+ background-color: $c-grey-alpine;
52
+ }
53
+
54
+ &:checked ~ label {
55
+ @include focus_colors;
56
+ @include single-box($c-status-neutral, 0.0625rem);
57
+ }
58
+ }
59
+
60
+ &:checked ~ label {
61
+ @include focus_colors;
62
+ }
63
+ }
64
+ }
65
+
66
+ label {
67
+ padding: 0.75rem 0.75rem 0.625rem 2.75rem;
68
+ border: 1px solid $c-grey-concrete;
69
+ border-radius: $border-radius-lg;
70
+ background-color: $white;
71
+ color: $c-grey-night;
72
+ font-weight: 400;
73
+
74
+ @if $state != disabled {
75
+ cursor: pointer;
76
+ }
77
+ }
78
+ }
@@ -1,5 +1,5 @@
1
- // paths more explicit for gulp-sass
2
- @import "~bourbon/core/bourbon.scss";
1
+ // paths more explicit for gulp-sass + iframe overrides
2
+ @import "../../node_modules/bourbon/core/bourbon";
3
3
 
4
4
  @mixin inset($val: 0) {
5
5
  bottom: $val;
@@ -18,6 +18,7 @@
18
18
  @import "focus.scss";
19
19
  @import "font.scss";
20
20
  @import "loading.scss";
21
+ @import "input.scss";
21
22
 
22
23
  @mixin table_link {
23
24
  @include focus {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "A collection of useful scss imports and js scripts, that provide consistent styling and functionality across barbican projects.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,8 +1,3 @@
1
1
  .custom-select {
2
- background-color: $c-grey-alpine;
3
- border-color: $c-grey-concrete;
4
- border-radius: $border-radius;
5
- padding: 0.75rem 0.5rem;
6
- color: $c-grey-night;
7
- width: 100%;
2
+ @include input-dropdown;
8
3
  }
package/scss/_input.scss CHANGED
@@ -1,10 +1,4 @@
1
1
 
2
- @mixin input-focus {
3
- @include single-box($c-grey-steel, 0.0625rem);
4
- border: 1px solid $c-grey-steel;
5
- background-color: $c-grey-alpine;
6
- }
7
-
8
2
  .form-control {
9
3
  @include focus {
10
4
  @include input-focus;
@@ -1,62 +1,10 @@
1
1
 
2
- $margin-radio: 0.25rem;
3
-
4
2
  .radio-group {
5
- margin: -$margin-radio;
3
+ margin: -0.25rem;
6
4
  }
7
5
 
8
6
  .custom-radio {
9
- display: inline-block;
10
- margin: $margin-radio;
11
- position: relative;
12
- padding: 0;
13
-
14
- input[type=radio] {
15
- $size: 0.875rem;
16
- position: absolute;
17
- cursor: pointer;
18
- height: $size;
19
- margin: auto;
20
- width: $size;
21
- right: auto;
22
- z-index: 3;
23
- left: 1rem;
24
- bottom: 0;
25
- top: 0;
26
-
27
- @mixin focus_colors {
28
- background-color: $c-status-neutral-fade;
29
- border: 1px solid $c-status-neutral;
30
- color: $c-status-neutral;
31
- }
32
-
33
- @include focus {
34
- ~ label {
35
- @include single-box($c-grey-steel, 0.0625rem);
36
- border: 1px solid $c-grey-steel;
37
- background-color: $c-grey-alpine;
38
- }
39
-
40
- &:checked ~ label {
41
- @include focus_colors;
42
- @include single-box($c-status-neutral, 0.0625rem);
43
- }
44
- }
45
-
46
- &:checked ~ label {
47
- @include focus_colors;
48
- }
49
- }
50
-
51
- label {
52
- padding: 0.75rem 0.75rem 0.625rem 2.75rem;
53
- border: 1px solid $c-grey-concrete;
54
- border-radius: $border-radius-lg;
55
- background-color: $white;
56
- color: $c-grey-night;
57
- font-weight: 400;
58
- cursor: pointer;
59
- }
7
+ @include input-radio;
60
8
  }
61
9
 
62
10
  @each $status, $color in $statees {