Skip to content

Commit 6a25867

Browse files
committed
feat: checkbox restyle
1 parent 67e81b1 commit 6a25867

File tree

7 files changed

+74
-20
lines changed

7 files changed

+74
-20
lines changed

common/loginpage/src/css/colors.less

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
--shadow-sidebar-item-pressed: 0px 1px 4px -1px rgba(0, 0, 0, 0.20);
5757
--layout-list-items-gap: 0;
5858
--action-active-font-weight: normal;
59+
60+
--chb-border-radius: 2px;
61+
--chb-check-mark-background: var(--text-normal);
62+
--chb-background-normal: var(--background-normal);
63+
--chb-background-checked: var(--background-normal);
64+
--chb-border-normal: var(--border-regular-control);
65+
--chb-border-checked: var(--border-regular-control);
5966
}
6067

6168
@background-normal: var(--background-normal);
@@ -113,4 +120,19 @@
113120
@disabled-element-opacity: var(--disabled-element-opacity);
114121
@theme-inverted-image-filter: var(--theme-inverted-image-filter);
115122
@layout-list-items-gap: var(--layout-list-items-gap, 0);
116-
@action-active-font-weight: var(--action-active-font-weight, normal);
123+
@action-active-font-weight: var(--action-active-font-weight, normal);
124+
125+
//@chb-size: var(--chb-size);
126+
//@chb-v-margin: var(--chb-v-margin);
127+
@chb-border-radius: var(--chb-border-radius);
128+
@chb-check-mark-background: var(--chb-check-mark-background);
129+
@chb-background-normal: var(--chb-background-normal);
130+
@chb-background-normal-hover: var(--chb-background-normal-hover);
131+
@chb-background-checked: var(--chb-background-checked);
132+
@chb-background-checked-hover: var(--chb-background-checked-hover);
133+
@chb-border-normal: var(--chb-border-normal);
134+
@chb-border-normal-hover: var(--chb-border-normal-hover);
135+
@chb-border-normal-focus: var(--chb-border-normal-focus);
136+
@chb-border-checked: var(--chb-border-checked);
137+
@chb-border-checked-hover: var(--chb-border-checked-hover);
138+
@chb-border-checked-focus: var(--chb-border-checked-focus);

common/loginpage/src/css/colors_contrast_dark.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,11 @@
4848

4949
--disabled-element-opacity: .3;
5050
--theme-inverted-image-filter: invert(1);
51+
52+
--chb-check-mark-background: var(--text-normal);
53+
--chb-background-normal: var(--background-normal);
54+
--chb-background-checked: var(--background-normal);
55+
--chb-border-normal: var(--border-regular-control);
56+
--chb-border-checked: var(--border-regular-control);
5157
}
5258
}

common/loginpage/src/css/colors_dark.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,11 @@
4848

4949
--disabled-element-opacity: .3;
5050
--theme-inverted-image-filter: invert(1);
51+
52+
--chb-check-mark-background: var(--text-normal);
53+
--chb-background-normal: var(--background-normal);
54+
--chb-background-checked: var(--background-normal);
55+
--chb-border-normal: var(--border-regular-control);
56+
--chb-border-checked: var(--border-regular-control);
5157
}
5258
}

common/loginpage/src/css/colors_night.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,11 @@
4949
--shadow-sidebar-item-pressed: 0px 1px 3px 0px rgba(0, 0, 0, 0.10), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
5050
--layout-list-items-gap: 0;
5151
--action-active-font-weight: 500;
52+
53+
--chb-check-mark-background: var(--text-normal);
54+
--chb-background-normal: var(--background-normal);
55+
--chb-background-checked: var(--background-normal);
56+
--chb-border-normal: var(--border-regular-control);
57+
--chb-border-checked: var(--border-regular-control);
5258
}
5359
}

common/loginpage/src/css/colors_white.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,11 @@
5757
--shadow-sidebar-item-pressed: 0px 1px 3px 0px rgba(0, 0, 0, 0.10), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
5858
--layout-list-items-gap: 0;
5959
--action-active-font-weight: 500;
60+
61+
--chb-check-mark-background: #fff;
62+
--chb-background-normal: var(--background-normal);
63+
--chb-background-checked: #4A87E7;
64+
--chb-border-normal: var(--border-regular-control);
65+
--chb-border-checked: #4A87E7;
6066
}
6167
}

common/loginpage/src/css/component.less

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,35 @@ input[type=checkbox] {
101101
content: "";
102102
display: block;
103103
position: absolute;
104-
width: 18px;
105-
height: 18px;
104+
width: 20px;
105+
height: 20px;
106106
top: 0;
107107
left: 0;
108-
border: @scaled-one-px solid @border-regular-control;
109-
border-radius: 3px;
110-
background-color: @background-normal;
108+
border: @scaled-one-px solid @chb-border-normal;
109+
border-radius: @chb-border-radius;
110+
background-color: @chb-background-normal;
111111
}
112112

113-
&:checked:after {
114-
content: "";
115-
display: block;
116-
width: 5px;
117-
height: 10px;
118-
border: solid @text-normal;
119-
border-width: 0 2px 2px 0;
120-
transform: rotate(45deg);
121-
position: absolute;
122-
top: 3px;
123-
left: 7px;
113+
&:checked {
114+
&:before {
115+
border-color: @chb-border-checked;
116+
background-color: @chb-background-checked;
117+
}
118+
119+
&::after {
120+
content: "";
121+
display: block;
122+
width: 5px;
123+
height: 10px;
124+
border: solid @chb-check-mark-background;
125+
border-width: 0 2px 2px 0;
126+
transform: rotate(45deg);
127+
position: absolute;
128+
top: 3px;
129+
left: 7px;
130+
}
124131
}
132+
125133
&:focus-visible {
126134
outline: 0;
127135
&:before {

common/loginpage/src/css/styles.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,9 +1737,9 @@ li.menu-item {
17371737
}
17381738

17391739
.checkbox {
1740-
width: 12px;
1741-
height: 18px;
1742-
margin-right: 16px;
1740+
width: 20px;
1741+
height: 20px;
1742+
margin-right: 12px;
17431743
margin-left: 0;
17441744
}
17451745

0 commit comments

Comments
 (0)