Skip to content

Commit c05d3d3

Browse files
committed
feat(input-group): use logic only if the background is not transparent
1 parent aca2903 commit c05d3d3

File tree

1 file changed

+54
-53
lines changed

1 file changed

+54
-53
lines changed

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
$search-hover-elevation: map.get($input-group-schema, 'search-hover-elevation');
148148
$search-disabled-elevation: map.get($input-group-schema, 'search-disabled-elevation');
149149

150-
@if $variant == 'material' {
150+
@if $variant == 'material' and $box-background != transparent {
151151
@if not($box-background-hover) and $box-background {
152152
$box-background-hover: var(--box-background);
153153
}
@@ -296,73 +296,74 @@
296296
}
297297

298298
//material search input
299+
@if $search-background != transparent {
300+
@if not($placeholder-color) and $search-background {
301+
$placeholder-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
302+
}
299303

300-
@if not($placeholder-color) and $search-background {
301-
$placeholder-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
302-
}
303-
304-
@if not($hover-placeholder-color) and $placeholder-color {
305-
$hover-placeholder-color: var(--placeholder-color);
306-
}
304+
@if not($hover-placeholder-color) and $placeholder-color {
305+
$hover-placeholder-color: var(--placeholder-color);
306+
}
307307

308-
@if not($idle-secondary-color) and $placeholder-color {
309-
$idle-secondary-color: var(--placeholder-color);
310-
}
308+
@if not($idle-secondary-color) and $placeholder-color {
309+
$idle-secondary-color: var(--placeholder-color);
310+
}
311311

312-
@if not($idle-text-color) and $search-background {
313-
$idle-text-color: adaptive-contrast(var(--search-background));
314-
}
312+
@if not($idle-text-color) and $search-background {
313+
$idle-text-color: adaptive-contrast(var(--search-background));
314+
}
315315

316-
@if not($focused-secondary-color) and $search-background {
317-
$focused-secondary-color: adaptive-contrast(var(--search-background));
318-
}
316+
@if not($focused-secondary-color) and $search-background {
317+
$focused-secondary-color: adaptive-contrast(var(--search-background));
318+
}
319319

320-
@if not($filled-text-color) and $search-background {
321-
$filled-text-color: adaptive-contrast(var(--search-background));
322-
}
320+
@if not($filled-text-color) and $search-background {
321+
$filled-text-color: adaptive-contrast(var(--search-background));
322+
}
323323

324-
@if not($filled-text-hover-color) and $search-background {
325-
$filled-text-hover-color: adaptive-contrast(var(--search-background));
326-
}
324+
@if not($filled-text-hover-color) and $search-background {
325+
$filled-text-hover-color: adaptive-contrast(var(--search-background));
326+
}
327327

328-
@if not($focused-text-color) and $search-background {
329-
$focused-text-color: adaptive-contrast(var(--search-background));
330-
}
328+
@if not($focused-text-color) and $search-background {
329+
$focused-text-color: adaptive-contrast(var(--search-background));
330+
}
331331

332-
@if not($input-prefix-color) and $search-background {
333-
$input-prefix-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
334-
}
332+
@if not($input-prefix-color) and $search-background {
333+
$input-prefix-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
334+
}
335335

336-
@if not($input-prefix-color--filled) and $search-background {
337-
$input-prefix-color--filled: adaptive-contrast(var(--search-background));
338-
}
336+
@if not($input-prefix-color--filled) and $search-background {
337+
$input-prefix-color--filled: adaptive-contrast(var(--search-background));
338+
}
339339

340-
@if not($input-prefix-color--focused) and $search-background {
341-
$input-prefix-color--focused: adaptive-contrast(var(--search-background));
342-
}
340+
@if not($input-prefix-color--focused) and $search-background {
341+
$input-prefix-color--focused: adaptive-contrast(var(--search-background));
342+
}
343343

344-
@if not($input-suffix-color) and $search-background {
345-
$input-suffix-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
346-
}
344+
@if not($input-suffix-color) and $search-background {
345+
$input-suffix-color: hsla(from adaptive-contrast(var(--search-background)) h s l / 0.6);
346+
}
347347

348-
@if not($input-suffix-color--filled) and $search-background {
349-
$input-suffix-color--filled: adaptive-contrast(var(--search-background));
350-
}
348+
@if not($input-suffix-color--filled) and $search-background {
349+
$input-suffix-color--filled: adaptive-contrast(var(--search-background));
350+
}
351351

352-
@if not($input-suffix-color--focused) and $search-background {
353-
$input-suffix-color--focused: adaptive-contrast(var(--search-background));
354-
}
352+
@if not($input-suffix-color--focused) and $search-background {
353+
$input-suffix-color--focused: adaptive-contrast(var(--search-background));
354+
}
355355

356-
@if not($search-disabled-background) and $search-background {
357-
$search-disabled-background: hsla(from var(--search-background) h s l / 0.4);
358-
}
356+
@if not($search-disabled-background) and $search-background {
357+
$search-disabled-background: hsla(from var(--search-background) h s l / 0.4);
358+
}
359359

360-
@if not($disabled-placeholder-color) and $search-disabled-background {
361-
$disabled-placeholder-color: adaptive-contrast(var(--search-disabled-background));
362-
}
360+
@if not($disabled-placeholder-color) and $search-disabled-background {
361+
$disabled-placeholder-color: adaptive-contrast(var(--search-disabled-background));
362+
}
363363

364-
@if not($disabled-text-color) and $search-disabled-background {
365-
$disabled-text-color: adaptive-contrast(var(--search-disabled-background));
364+
@if not($disabled-text-color) and $search-disabled-background {
365+
$disabled-text-color: adaptive-contrast(var(--search-disabled-background));
366+
}
366367
}
367368

368369
@if not($search-resting-shadow) {
@@ -377,7 +378,7 @@
377378
$search-disabled-shadow: elevation($search-disabled-elevation);
378379
}
379380

380-
//end material search input
381+
// //end material search input
381382

382383
@if not($input-prefix-color) and $input-suffix-color {
383384
$input-prefix-color: var(--input-suffix-color);

0 commit comments

Comments
 (0)