Skip to content

Commit c359c34

Browse files
authored
feat(ui): various admin panel styling improvements (#7121)
- Improves color contrast of various components in the admin panel. - Adjusts placement of field error tooltips for consistency. - Corrects misaligned modals. - Fixes issue where `admin.layout: vertical` was not being applied to `radio` fields.
1 parent 6578b85 commit c359c34

File tree

27 files changed

+102
-159
lines changed

27 files changed

+102
-159
lines changed

packages/next/src/views/Edit/Default/Auth/index.scss

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,26 @@
4848

4949
@keyframes highlight {
5050
0% {
51-
background: var(--theme-success-500);
51+
background: var(--theme-success-250);
52+
border: 1px solid var(--theme-success-500);
53+
}
54+
55+
20% {
56+
background: var(--theme-input-bg);
57+
border: 1px solid var(--theme-elevation-250);
58+
color: var(--theme-text);
59+
}
60+
61+
80% {
62+
background: var(--theme-input-bg);
63+
border: 1px solid var(--theme-elevation-250);
64+
color: var(--theme-text);
5265
}
5366

5467
100% {
55-
background: none;
68+
background: var(--theme-elevation-200);
69+
border: 1px solid transparent;
70+
color: var(--theme-elevation-400);
5671
}
5772
}
5873

packages/next/src/views/Version/SelectComparison/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
border: 1px solid var(--theme-error-500);
44
min-height: calc(var(--base) * 2);
55
padding: calc(var(--base) * 0.5) calc(var(--base) * 0.75);
6-
background-color: var(--theme-error-500);
6+
background-color: var(--theme-error-100);
77
color: var(--theme-elevation-0);
88
}
99

packages/richtext-lexical/src/features/horizontalRule/plugin/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
}
1616

1717
.LexicalEditorTheme__hr.selected {
18-
outline: 2px solid var(--theme-success-500);
18+
outline: 2px solid var(--theme-success-250);
1919
user-select: none;
2020
}

packages/richtext-lexical/src/field/Field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ const _RichText: React.FC<
8888
width,
8989
}}
9090
>
91+
<FieldError CustomError={CustomError} path={path} {...(errorProps || {})} alignCaret="left" />
9192
<FieldLabel
9293
CustomLabel={CustomLabel}
9394
label={label}
9495
required={required}
9596
{...(labelProps || {})}
9697
/>
9798
<div className={`${baseClass}__wrap`}>
98-
<FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />
9999
<ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>
100100
<LexicalProvider
101101
editorConfig={editorConfig}

packages/richtext-lexical/src/field/index.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
@import '../scss/styles.scss';
22

33
.rich-text-lexical {
4+
& > .field-error.tooltip {
5+
right: auto;
6+
position: static;
7+
margin-bottom: 0.2em;
8+
max-width: fit-content;
9+
}
10+
411
.errorBoundary {
512
pre {
613
text-wrap: unset;

packages/ui/src/elements/Banner/index.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838

3939
&--type-error {
4040
background: var(--theme-error-100);
41-
color: var(--theme-error-500);
41+
color: var(--theme-error-600);
4242

4343
svg {
44-
@include color-svg(var(--theme-error-500));
44+
@include color-svg(var(--theme-error-600));
4545
}
4646

4747
&.button--has-action {
@@ -56,8 +56,8 @@
5656
}
5757

5858
&--type-success {
59-
background: var(--theme-success-500);
60-
color: var(--color-base-800);
59+
background: var(--theme-success-100);
60+
color: var(--theme-success-600);
6161

6262
&.button--has-action {
6363
&:hover {

packages/ui/src/elements/Collapsible/index.scss

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -113,58 +113,24 @@
113113
padding: var(--gutter-h);
114114
}
115115
}
116-
}
117-
118-
html[data-theme='dark'] {
119-
.collapsible {
120-
&--style-error {
121-
border: 1px solid var(--theme-error-400);
122-
&:hover {
123-
border: 1px solid var(--theme-error-500);
124-
}
125-
126-
> .collapsible__toggle-wrap {
127-
.row-label {
128-
color: var(--theme-error-500);
129-
}
130-
.collapsible__toggle {
131-
background: var(--theme-error-100);
132-
}
133-
}
134-
&.collapsible--hovered {
135-
> .collapsible__toggle-wrap .collapsible__toggle {
136-
background: var(--theme-error-150);
137-
}
138-
}
139-
}
140-
}
141-
}
142116

143-
html[data-theme='light'] {
144-
.collapsible {
145-
&--style-error {
117+
&--style-error {
118+
border: 1px solid var(--theme-error-400);
119+
&:hover {
146120
border: 1px solid var(--theme-error-500);
147-
&:hover {
148-
border: 1px solid var(--theme-error-600);
149-
}
121+
}
150122

151-
> .collapsible__toggle-wrap {
152-
.row-label {
153-
color: var(--theme-error-750);
154-
}
155-
.collapsible__toggle {
156-
background: var(--theme-error-50);
157-
}
123+
> .collapsible__toggle-wrap {
124+
.row-label {
125+
color: var(--theme-error-950);
158126
}
159-
&.collapsible--hovered {
160-
> .collapsible__toggle-wrap .collapsible__toggle {
161-
background: var(--theme-error-100);
162-
}
127+
.collapsible__toggle {
128+
background: var(--theme-error-100);
163129
}
164-
&.error {
165-
& input {
166-
border-color: var(--theme-error-500);
167-
}
130+
}
131+
&.collapsible--hovered {
132+
> .collapsible__toggle-wrap .collapsible__toggle {
133+
background: var(--theme-error-150);
168134
}
169135
}
170136
}

packages/ui/src/elements/ErrorPill/index.scss

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
display: flex;
1515
align-items: center;
1616
justify-content: center;
17+
background: var(--theme-error-300);
18+
color: var(--theme-error-950);
1719

1820
&--fixed-width {
1921
width: 18px;
@@ -27,17 +29,3 @@
2729
margin-left: 0.5px;
2830
}
2931
}
30-
31-
html[data-theme='light'] {
32-
.error-pill {
33-
background: var(--theme-error-250);
34-
color: var(--theme-error-750);
35-
}
36-
}
37-
38-
html[data-theme='dark'] {
39-
.error-pill {
40-
background: var(--theme-error-500);
41-
color: var(--color-base-1000);
42-
}
43-
}

packages/ui/src/elements/GenerateConfirmation/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@include blur-bg;
55
display: flex;
66
align-items: center;
7+
justify-content: center;
78
height: 100%;
89

910
&__template {

packages/ui/src/elements/Pill/index.scss

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@
111111
}
112112

113113
&--style-warning {
114-
background: var(--theme-warning-500);
114+
background: var(--theme-warning-150);
115+
color: var(--theme-warning-800);
115116
}
116117

117118
&--style-success {
118-
background: var(--theme-success-500);
119-
color: var(--color-base-800);
119+
background: var(--theme-success-150);
120+
color: var(--theme-success-800);
121+
}
122+
123+
&--style-error {
124+
background: var(--theme-error-150);
125+
color: var(--theme-error-800);
120126
}
121127

122128
&--style-dark {
@@ -138,21 +144,3 @@
138144
}
139145
}
140146
}
141-
142-
html[data-theme='dark'] {
143-
.pill {
144-
&--style-error {
145-
background: var(--theme-error-500);
146-
color: var(--color-base-1000);
147-
}
148-
}
149-
}
150-
151-
html[data-theme='light'] {
152-
.pill {
153-
&--style-error {
154-
background: var(--theme-error-250);
155-
color: var(--theme-error-750);
156-
}
157-
}
158-
}

0 commit comments

Comments
 (0)