Skip to content

Commit 148f521

Browse files
SurenNewarerfrandse
authored andcommitted
Add new style guide to global button style
- Updated new style guide for Primary, Secondary and Link button variants - Changed box-shadow style from outer to inside on focus and active state - Updated font weight from bold to regular for normal buttons and font weight bold for link button. Signed-off-by: Suren Neware <[email protected]> Change-Id: I38ca94baa9daec3fd03b830fc7b6d676fcce15b0
1 parent 87360ed commit 148f521

File tree

7 files changed

+81
-63
lines changed

7 files changed

+81
-63
lines changed
Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.btn {
2-
font-weight: $headings-font-weight;
32
padding-top: $spacer / 2;
43
padding-right: $spacer;
54
padding-bottom: $spacer / 2;
@@ -10,34 +9,72 @@
109
svg + span {
1110
margin-left: $spacer / 4;
1211
}
12+
&:disabled {
13+
color: gray("600");
14+
fill: currentColor;
15+
box-shadow: none !important;
16+
&:not(.btn-link) {
17+
border-color: gray("400");
18+
background-color: gray("400");
19+
}
20+
}
1321
}
1422

1523
.btn-primary {
1624
fill: currentColor;
25+
&:focus,
26+
&:not(:disabled):not(.disabled):active:focus {
27+
border-color: $white;
28+
box-shadow: inset 0 0 0 3px theme-color('primary'), inset 0 0 0 5px $white;
29+
}
1730
}
1831

1932
.btn-secondary {
2033
fill: currentColor;
34+
&:focus,
35+
&:not(:disabled):not(.disabled):active:focus {
36+
border-color: $white;
37+
box-shadow: inset 0 0 0 3px theme-color('secondary'), inset 0 0 0 5px $white;
38+
}
2139
}
2240

41+
// Global style for all button link
2342
.btn-link {
43+
font-weight: $headings-font-weight;
2444
fill: theme-color("primary");
2545
text-decoration: none !important;
26-
46+
&:hover {
47+
background-color: gray("200");
48+
color: theme-color("primary");
49+
}
50+
&:active {
51+
background-color: gray("300");
52+
}
2753
&:focus {
28-
box-shadow: $btn-focus-box-shadow;
54+
box-shadow: inset 0 0 0 2px theme-color("primary");
55+
color: theme-color("primary");
56+
outline: none;
2957
}
30-
&:hover {
31-
fill: darken(theme-color("primary"), 15%);
58+
&:disabled {
59+
box-shadow: $btn-focus-box-shadow;
3260
}
3361
}
3462

35-
.btn:disabled {
36-
color: gray("600");
37-
fill: currentColor;
38-
39-
&:not(.btn-link) {
40-
border-color: gray("400");
41-
background-color: gray("400");
63+
// Datepicker and Password toggle buttons
64+
.input-action {
65+
position: absolute;
66+
right: 0;
67+
}
68+
.input-action .btn-link,
69+
.input-action-btn {
70+
position: absolute;
71+
right: 1px;
72+
top: 1px;
73+
z-index: $zindex-dropdown + 1;
74+
padding: 0;
75+
width: 36px;
76+
height: 35.8px;
77+
svg {
78+
vertical-align: sub;
4279
}
4380
}
Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1+
// Make calendar visible over the table
2+
.dropdown-menu {
3+
z-index: $zindex-dropdown + 1;
4+
padding: 0;
5+
}
16
.dropdown-item {
27
padding-left: $spacer/2;
38
}
4-
59
.b-dropdown-form {
610
padding: $spacer/2;
711
.form-group {
812
margin-bottom: $spacer/2;
913
}
1014
}
11-
12-
// Adding component style to global stylesheet because
13-
// single-file component scoped styles aren't
14-
// being applied to dynamically appended elements
15-
// The overflow menu should be above the table
16-
15+
// Table filter dropdown clear button style
1716
.table-filter {
18-
.dropdown-menu {
19-
z-index: $zindex-dropdown + 1;
20-
padding: 0;
21-
.dropdown-item {
22-
&:hover {
23-
background-color: gray("200");
24-
}
25-
&:active {
26-
background-color: gray("300");
27-
}
28-
&:focus {
29-
outline: none;
30-
background-color: transparent;
31-
box-shadow: inset 0 0 0 2px theme-color("primary");
32-
}
17+
.dropdown-item {
18+
&:hover {
19+
background-color: gray("200");
20+
}
21+
&:active {
22+
background-color: gray("300");
23+
}
24+
&:focus {
25+
outline: none;
26+
background-color: transparent;
27+
box-shadow: inset 0 0 0 2px theme-color("primary");
3328
}
3429
}
3530
}

src/assets/styles/bmc/custom/_forms.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,6 @@
117117
}
118118
}
119119

120-
.b-form-datepicker {
121-
position: absolute;
122-
right: 0;
123-
top: 0;
124-
z-index: $zindex-dropdown + 1;
125-
.btn {
126-
padding: 0.4rem 1rem;
127-
svg {
128-
margin-left: 0;
129-
}
130-
}
131-
}
132-
133120
// Form validation icon
134121
.form-control.is-invalid,
135122
.form-control.is-valid {

src/assets/styles/bmc/custom/_tables.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
&:last-of-type {
1212
border-right: 1px solid gray("300");
1313
}
14+
15+
// Table action buttons
16+
.btn-link {
17+
width: 40px;
18+
height: 40px;
19+
padding: 5px !important;
20+
display: inline-flex;
21+
justify-content: center;
22+
align-items: center;
23+
}
1424
}
1525

1626
// thead-light added for specificiy
@@ -147,4 +157,4 @@
147157
.table.b-table.b-table-stacked-sm > tbody > tr > :first-child {
148158
border-top-width: 1px;
149159
}
150-
}
160+
}

src/components/Global/InputPasswordToggle.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<b-button
55
:aria-label="$t('global.ariaLabel.showPassword')"
66
variant="link"
7+
class="input-action-btn"
78
:class="{ isVisible: isVisible }"
89
@click="toggleVisibility"
910
>
@@ -52,15 +53,4 @@ export default {
5253
.input-password-toggle-container {
5354
position: relative;
5455
}
55-
56-
.btn {
57-
position: absolute;
58-
right: 0;
59-
top: 0;
60-
padding: 0.4rem 1rem;
61-
svg {
62-
margin-left: 0;
63-
vertical-align: sub;
64-
}
65-
}
6656
</style>

src/components/Global/TableDateFilter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<template slot:append>
2727
<b-form-datepicker
2828
v-model="fromDate"
29+
class="input-action"
2930
button-only
3031
right
31-
size="sm"
3232
:max="toDate"
3333
:hide-header="true"
3434
:locale="locale"
@@ -76,9 +76,9 @@
7676
<template slot:append>
7777
<b-form-datepicker
7878
v-model="toDate"
79+
class="input-action"
7980
button-only
8081
right
81-
size="sm"
8282
:min="fromDate"
8383
:hide-header="true"
8484
:locale="locale"

src/views/Configuration/DateTimeSettings/DateTimeSettings.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@
7373
</b-form-invalid-feedback>
7474
<b-form-datepicker
7575
v-model="form.manual.date"
76+
class="input-action"
7677
button-only
77-
right
78-
size="sm"
7978
:hide-header="true"
8079
:locale="locale"
8180
:label-help="

0 commit comments

Comments
 (0)