Skip to content

Commit 4c201ad

Browse files
committed
Add focused shadow switch
1 parent 9441056 commit 4c201ad

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

scss/_components.button.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$btn-border-radius: $shape-border-radius-md !default;
44
$btn-border-width: $shape-border-width !default;
55
$btn-line-height: $line-height-normal !default;
6+
$enable-btn-focus-shadow: true !default;
67

78
$btn-padding-sm: $spacing-squish-xs !default;
89
$btn-font-size-sm: $text-size-sm !default;

scss/_components.form.scss

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $form-field-margin-bottom: $spacing-stack-md !default;
1212
$form-help-margin-top: $spacing-stack-xs !default;
1313
$form-help-color: $grey-mute !default;
1414
$form-addon-bg: $grey-light !default;
15+
$enable-form-focus-shadow: true !default;
1516

1617
$form-control-padding-sm: $spacing-squish-xs !default;
1718
$form-control-font-size-sm: $text-size-sm !default;
@@ -66,7 +67,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
6667
&:focus,
6768
&.is-focused {
6869
border-color: $color-primary;
69-
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
70+
@if $enable-form-focus-shadow {
71+
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
72+
}
7073
}
7174

7275
&:disabled {
@@ -92,7 +95,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
9295
&:focus,
9396
&.is-focused {
9497
border-color: $color-success;
95-
box-shadow: 0 0 0 2px rgba($color-success, 0.25);
98+
@if $enable-form-focus-shadow {
99+
box-shadow: 0 0 0 2px rgba($color-success, 0.25);
100+
}
96101
}
97102
}
98103

@@ -106,7 +111,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
106111
&:focus,
107112
&.is-focused {
108113
border-color: $color-danger;
109-
box-shadow: 0 0 0 2px rgba($color-danger, 0.25);
114+
@if $enable-form-focus-shadow {
115+
box-shadow: 0 0 0 2px rgba($color-danger, 0.25);
116+
}
110117
}
111118
}
112119

@@ -120,7 +127,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
120127
&:focus,
121128
&.is-focused {
122129
border-color: $color-warning;
123-
box-shadow: 0 0 0 2px rgba($color-warning, 0.25);
130+
@if $enable-form-focus-shadow {
131+
box-shadow: 0 0 0 2px rgba($color-warning, 0.25);
132+
}
124133
}
125134
}
126135
}
@@ -235,7 +244,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
235244
&:focus,
236245
&.is-focused {
237246
border-color: $color-primary;
238-
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
247+
@if $enable-form-focus-shadow {
248+
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
249+
}
239250
}
240251

241252
&:disabled {
@@ -278,7 +289,9 @@ $form-control-height-computed: $form-control-font-size-md * $form-contr
278289
&:focus,
279290
&.is-focused {
280291
border-color: $color-primary;
281-
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
292+
@if $enable-form-focus-shadow {
293+
box-shadow: 0 0 0 2px rgba($color-primary, 0.25);
294+
}
282295
&:checked {
283296
box-shadow: inset 0 0 0 ($form-radio-size / 3) $form-radio-active-color, 0 0 0 2px rgba($color-primary, 0.25);
284297
}

scss/mixins/_button.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
&:focus,
2828
&.is-focused {
29-
box-shadow: 0 0 0 2px rgba($active-background, 0.25);
29+
@if $enable-btn-focus-shadow {
30+
box-shadow: 0 0 0 2px rgba($active-background, 0.25);
31+
}
3032
}
3133

3234
&:active,
@@ -78,7 +80,9 @@
7880

7981
&:focus,
8082
&.is-focused {
81-
box-shadow: 0 0 0 2px rgba($active-color, 0.25);
83+
@if $enable-btn-focus-shadow {
84+
box-shadow: 0 0 0 2px rgba($active-color, 0.25);
85+
}
8286
}
8387

8488
&:active,

0 commit comments

Comments
 (0)