Skip to content

Commit a157e3d

Browse files
committed
lux: fix btn-outline in light and dark mode, closes #1331
1 parent 73c02fe commit a157e3d

16 files changed

+1022
-804
lines changed

dist/lux/_bootswatch.scss

Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,40 +58,45 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;3
5858
font-size: 10px;
5959
}
6060

61-
&-warning {
62-
&,
63-
&:hover,
64-
&:not([disabled]):not(.disabled):active,
65-
&:focus {
66-
color: $white;
67-
}
61+
&-primary {
62+
--bs-btn-hover-bg: #{$black};
63+
--bs-btn-hover-border-color: #{$black};
64+
--bs-btn-active-bg: #{$black};
65+
--bs-btn-active-border-color: #{$black};
6866
}
69-
}
70-
71-
.btn-outline-secondary {
72-
color: $gray-600;
73-
border-color: $gray-600;
7467

75-
&.disabled,
76-
&:disabled,
77-
fieldset:disabled & {
78-
color: $gray-600;
79-
border-color: $gray-600;
68+
&-secondary {
69+
--bs-btn-hover-bg: #{$gray-200};
70+
--bs-btn-hover-border-color: #{$gray-200};
71+
--bs-btn-active-bg: #{$gray-300};
72+
--bs-btn-active-border-color: #{$gray-300};
8073
}
8174

82-
&:not([disabled]):not(.disabled):hover,
83-
&:not([disabled]):not(.disabled):focus,
84-
&:not([disabled]):not(.disabled):active {
85-
color: $white;
86-
background-color: $gray-400;
87-
border-color: $gray-400;
75+
&-light {
76+
--bs-btn-hover-bg: #{$gray-300};
77+
--bs-btn-hover-border-color: #{$gray-300};
78+
--bs-btn-active-bg: #{$gray-400};
79+
--bs-btn-active-border-color: #{$gray-400};
8880
}
8981

90-
&:not([disabled]):not(.disabled):focus {
91-
box-shadow: 0 0 0 .2rem rgba($gray-400, .5);
82+
&-link {
83+
font-weight: $btn-font-weight;
9284
}
9385
}
9486

87+
.btn-outline-secondary {
88+
--bs-btn-color: #{$black};
89+
--bs-btn-hover-bg: #{$gray-200};
90+
--bs-btn-hover-border-color: #{$gray-200};
91+
--bs-btn-active-bg: #{$gray-300};
92+
--bs-btn-active-border-color: #{$gray-300};
93+
border-color: $gray-100;
94+
}
95+
96+
.btn-outline-light {
97+
color: var(--bs-btn-active-color);
98+
}
99+
95100
[class*="btn-outline-"] {
96101
border-width: 2px;
97102
}
@@ -102,7 +107,37 @@ $web-font-path: "https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;3
102107

103108
@include color-mode(dark) {
104109
.btn-primary {
105-
background-color: #080808;
110+
--bs-btn-bg: #080808;
111+
--bs-btn-hover-bg: #{$black};
112+
}
113+
114+
.btn-outline-primary {
115+
color: $white;
116+
border-color: #080808;
117+
--bs-btn-hover-bg: #{$black};
118+
}
119+
120+
.btn-outline-secondary {
121+
--bs-btn-color: #{$white};
122+
--bs-btn-hover-color: #{$black};
123+
--bs-btn-hover-bg: #{$gray-200};
124+
--bs-btn-hover-border-color: #{$gray-200};
125+
--bs-btn-active-bg: #{$gray-300};
126+
--bs-btn-active-border-color: #{$gray-300};
127+
}
128+
129+
.btn-outline-light {
130+
color: $white;
131+
132+
&:not([disabled]):not(.disabled):hover,
133+
&:not([disabled]):not(.disabled):focus,
134+
&:not([disabled]):not(.disabled):active {
135+
color: var(--bs-btn-active-color);
136+
}
137+
}
138+
139+
.btn-outline-dark {
140+
color: $white;
106141
}
107142
}
108143

dist/lux/_variables.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ $theme: "lux" !default;
99

1010
$white: #fff !default;
1111
$gray-100: #f8f9fa !default;
12-
$gray-200: #f7f7f9 !default;
13-
$gray-300: #eceeef !default;
14-
$gray-400: #ced4da !default;
12+
$gray-200: #f0f1f2 !default;
13+
$gray-300: #e0e1e2 !default;
14+
$gray-400: #cdcecf !default;
1515
$gray-500: #adb5bd !default;
1616
$gray-600: #919aa1 !default;
1717
$gray-700: #55595c !default;
@@ -36,7 +36,7 @@ $success: $green !default;
3636
$info: $cyan !default;
3737
$warning: $yellow !default;
3838
$danger: $red !default;
39-
$light: $white !default;
39+
$light: $gray-200 !default;
4040
$dark: $gray-800 !default;
4141

4242
$min-contrast-ratio: 1.9 !default;

0 commit comments

Comments
 (0)