Skip to content

Commit 94255de

Browse files
authored
feat(query-builder): improve query-builder theme (#15675)
1 parent 99151c1 commit 94255de

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

projects/igniteui-angular/src/lib/core/styles/components/query-builder/_query-builder-theme.scss

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,36 @@
5252
}
5353

5454
$theme: digest-schema($query-builder-schema);
55-
$meta: map.get($theme, '_meta');
55+
$variant: map.get($theme, '_meta', 'theme');
5656

57-
@if not($header-foreground) and $header-background {
58-
$header-foreground: text-contrast($header-background);
57+
@if not($label-foreground) and $background {
58+
$label-foreground: hsla(from adaptive-contrast(var(--background)) h s l / 0.6);
5959
}
6060

6161
@if not($header-background) and $background {
62-
$header-background: $background;
62+
$header-background: var(--background);
63+
}
64+
65+
@if not($header-foreground) and $header-background {
66+
$header-foreground: adaptive-contrast(var(--header-background));
67+
}
68+
69+
@if not($subquery-header-background) and $header-background {
70+
$subquery-header-background: hsl(from var(--header-background) h s calc(l * 0.9));
71+
}
72+
73+
@if not($subquery-border-color) and $subquery-header-background {
74+
$subquery-border-color: hsl(from var(--subquery-header-background) h s calc(l * 0.9));
75+
}
76+
77+
@if not($separator-color) and $subquery-border-color {
78+
$separator-color: hsl(from var(--subquery-border-color) h s calc(l * 0.9));
79+
}
80+
81+
@if $variant == 'bootstrap' {
82+
@if not($header-border) and $subquery-border-color {
83+
$header-border: var(--subquery-border-color);
84+
}
6385
}
6486

6587
@return extend($theme, (
@@ -77,11 +99,6 @@
7799
separator-color: $separator-color,
78100
border-radius: $border-radius,
79101
label-foreground: $label-foreground,
80-
theme: map.get($schema, '_meta', 'theme'),
81-
_meta: map.merge(if($meta, $meta, ()), (
82-
variant: map.get($schema, '_meta', 'theme'),
83-
theme-variant: map.get($schema, '_meta', 'variant')
84-
)),
85102
));
86103
}
87104

@@ -98,8 +115,8 @@
98115
@mixin query-builder($theme) {
99116
@include css-vars($theme);
100117

101-
$variant: map.get($theme, '_meta', 'variant');
102-
$theme-variant: map.get($theme, '_meta', 'theme-variant');
118+
$variant: map.get($theme, '_meta', 'theme');
119+
$theme-variant: map.get($theme, '_meta', 'variant');
103120
$bootstrap-theme: $variant == 'bootstrap';
104121
$not-bootstrap-theme: not($bootstrap-theme);
105122

0 commit comments

Comments
 (0)