Skip to content

Commit 109f841

Browse files
committed
Use Less variables
1 parent f798e76 commit 109f841

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

asset/css/callout.less

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
.callout {
3232
padding: .5em 1em;
3333
border: 1px solid var(--callout-color);
34-
background-color: color-mix(in srgb, var(--callout-color) 10%, transparent);
34+
background-color: var(--callout-bg-color);
3535
border-radius: .25em;
3636

3737
i.icon {
@@ -40,18 +40,22 @@
4040
}
4141

4242
&.callout-type-info {
43-
--callout-color: @color-pending;
43+
--callout-color: @callout-info-color;
44+
--callout-bg-color: @callout-info-background-color;
4445
}
4546

4647
&.callout-type-success {
47-
--callout-color: @color-ok;
48+
--callout-color: @callout-success-color;
49+
--callout-bg-color: @callout-success-background-color;
4850
}
4951

5052
&.callout-type-warning {
51-
--callout-color: @color-warning;
53+
--callout-color: @callout-warning-color;
54+
--callout-bg-color: @callout-warning-background-color;
5255
}
5356

5457
&.callout-type-error {
55-
--callout-color: @color-critical;
58+
--callout-color: @callout-error-color;
59+
--callout-bg-color: @callout-error-background-color;
5660
}
5761
}

asset/css/variables.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
@schedule-element-fields-disabled-selected-bg: @base-gray-light;
131131
@schedule-element-keyboard-note-bg: @base-gray-light;
132132

133+
@callout-success-color: @state-ok;
134+
@callout-info-color: @base-primary-color;
135+
@callout-warning-color: @state-warning;
136+
@callout-error-color: @state-critical;
137+
138+
@callout-success-background-color: fade(@state-ok, 10%);
139+
@callout-info-background-color: fade(@base-primary-bg, 10%);
140+
@callout-warning-background-color: fade(@state-warning, 10%);
141+
@callout-error-background-color: fade(@state-critical, 10%);
142+
133143
@empty-state-color: @base-gray-semilight;
134144
@empty-state-bar-bg: @base-gray-lighter;
135145

0 commit comments

Comments
 (0)