Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const themeChoose = html`
<igc-select
value="bootstrap"
outlined
label="Choose theme"
title="Choose theme"
@igcChange=${({ detail }) => setTheme(detail.value)}
>
${themes.map(theme => html`<igc-select-item .value=${theme}>${theme}</igc-select-item>`)}
Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
body {
--ig-size: 1;
--sample-body-padding: 20px;
background: hsla(var(--ig-surface-100));
background: var(--ig-surface-300);
margin: 0;
padding: var(--sample-body-padding);
overflow: hidden;
Expand All @@ -34,7 +34,7 @@
align-items: center;
padding: 0.5rem 0;
gap: 1rem;
min-height: 79px;
min-height: 75px;
}

#demo {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"concurrently": "^9.2.0",
"globby": "^14.1.0",
"husky": "^9.1.7",
"igniteui-theming": "^22.1.0",
"igniteui-theming": "^24.0.0",
"lint-staged": "^16.1.2",
"node-watch": "^0.7.4",
"playwright": "^1.53.2",
Expand Down
7 changes: 4 additions & 3 deletions src/components/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import { asArray, autoGenerateColumns, getFilterOperandsFor } from '../internal/
import { watch } from '../internal/watch.js';
import type { FilterExpression } from '../operations/filter/types.js';
import type { SortExpression } from '../operations/sort/types.js';
import { styles } from '../styles/grid/themes/grid.base.css.js';
import { all } from '../styles/grid/themes/themes.js';
import { styles } from '../styles/themes/grid.base.css.js';
import { all } from '../styles/themes/grid-themes.js';
import { styles as shared } from '../styles/themes/shared/grid.common.css.js';
import IgcGridLiteCell from './cell.js';
import IgcFilterRow from './filter-row.js';
import IgcGridLiteHeaderRow from './header-row.js';
Expand Down Expand Up @@ -135,7 +136,7 @@ export class IgcGridLite<T extends object> extends EventEmitterBase<IgcGridLiteE
return GRID_TAG;
}

public static override styles = styles;
public static override styles = [styles, shared];

public static register() {
registerComponent(
Expand Down
7 changes: 7 additions & 0 deletions src/components/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import {
import { partNameMap } from '../internal/part-map.js';
import { registerComponent } from '../internal/register.js';
import { GRID_HEADER_TAG } from '../internal/tags.js';
import { addThemingController } from '../internal/theming.js';
import type { ColumnConfiguration, IgcHeaderContext } from '../internal/types.js';
import { styles } from '../styles/header-cell/header-cell.css.js';
import { all } from '../styles/themes/grid-header-themes.js';

export default class IgcGridLiteHeader<T extends object> extends LitElement {
public static get tagName() {
Expand Down Expand Up @@ -47,6 +49,11 @@ export default class IgcGridLiteHeader<T extends object> extends LitElement {
@property({ attribute: false })
public column!: ColumnConfiguration<T>;

constructor() {
super();

addThemingController(this, all);
}
#addResizeEventHandlers() {
const config: AddEventListenerOptions = { once: true };

Expand Down
12 changes: 5 additions & 7 deletions src/internal/theming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ function isOfTypeThemeVariant(variant: string): variant is ThemeVariant {
}

function getTheme() {
if (!(theme && themeVariant)) {
const cssVars = getAllCssVariables();
const foundTheme = cssVars.igTheme;
const foundVariant = cssVars.igThemeVariant;
const cssVars = getAllCssVariables();
const foundTheme = cssVars.igTheme;
const foundVariant = cssVars.igThemeVariant;

theme = isOfTypeTheme(foundTheme) ? foundTheme : 'bootstrap';
themeVariant = isOfTypeThemeVariant(foundVariant) ? foundVariant : 'light';
}
theme = isOfTypeTheme(foundTheme) ? foundTheme : 'bootstrap';
themeVariant = isOfTypeThemeVariant(foundVariant) ? foundVariant : 'light';

return { theme, themeVariant };
}
Expand Down
43 changes: 38 additions & 5 deletions src/styles/_common.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
@use "../../node_modules/igniteui-theming/" as *;
@forward "../../node_modules/igniteui-theming/";
@use 'igniteui-theming' as *;
@forward 'igniteui-theming';

$ig-cells-padding: sizable(rem(8px), rem(16px), rem(24px));
$ig-cells-min-height: sizable(rem(24px), rem(34px), rem(50px));

:host {
@include sizable();
@mixin ig-scrollbar($track-size, $track-bg, $thumb-bg) {
// Firefox only
scrollbar-width: $track-size;
scrollbar-color: $thumb-bg $track-bg;

// Chromium only
::-webkit-scrollbar {
width: $track-size;
height: $track-size;
background: $track-bg;
}

::-webkit-scrollbar-thumb {
background: $thumb-bg;
}
}

--component-size: 3;
:host {
@include sizable();

--component-size: 3;


position: relative;
box-sizing: border-box;

@include ig-scrollbar(
var(--ig-scrollbar-size, var(--sb-size)),
var(--ig-scrollbar-track-background, var(--sb-track-bg-color)),
var(--ig-scrollbar-thumb-background, var(--sb-thumb-bg-color))
);

*,
*::before,
*::after {
box-sizing: border-box;
}
}
64 changes: 35 additions & 29 deletions src/styles/body-cell/body-cell.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '../common' as *;
@use '../themes/light/themes' as *;

$row-border-width: var(--igx-row-border-width, var(--row-border-width));
$cell-active-border-color: var(--igx-cell-active-border-color, var(--cell-active-border-color));
$theme: $material;
$inset-shadow-width: #{rem(1px)};

:host {
Expand All @@ -11,8 +11,8 @@ $inset-shadow-width: #{rem(1px)};
align-items: center;
padding: 0 $ig-cells-padding;
color: inherit;
border-right: $row-border-width solid transparent;
font-size: #{rem(13px)};
border-right: rem(1px) solid transparent;
font-size: rem(13px);
overflow-wrap: anywhere;

&:last-of-type {
Expand All @@ -22,40 +22,46 @@ $inset-shadow-width: #{rem(1px)};

:host([active]) {
outline: none;
box-shadow: inset 0 0 0 $inset-shadow-width $cell-active-border-color;
box-shadow: inset 0 0 0 $inset-shadow-width var-get($theme, 'cell-active-border-color');
color: var-get($theme, 'cell-selected-text-color');
background: var-get($theme, 'cell-selected-background');
}

:host(:last-child) {
border-inline-end: none;
}

igc-input {
position: absolute;
left: 0;
height: calc(100% - ($inset-shadow-width * 2));
width: 100%;

&::part(container),
&::part(input) {
border-color: transparent;
box-shadow: none;
height: 100%;
}
position: absolute;
left: 0;
height: calc(100% - ($inset-shadow-width * 2));
width: 100%;
}

igc-input,
igc-select {
&::part(container),
&::part(input) {
background: inherit;
color: inherit;
font-size: #{rem(13px)};
}

&::part(helper-text),
&::part(container) {
&::after {
display: none;
}
}
&::part(container) {
height: calc(100% - ($inset-shadow-width * 2));

&::before {
box-shadow: none;
}
}

&::part(container),
&::part(input) {
box-shadow: none;
height: 100%;
background: inherit;
border: 0;
color: inherit;
font-size: rem(13px);
}

&::part(helper-text),
&::part(container) {
&::after {
display: none;
}
}
}
30 changes: 14 additions & 16 deletions src/styles/body-row/body-row.scss
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
@use '../common' as *;
@use '../themes/light/themes' as *;

$row-border-width: var(--igx-row-border-width, var(--header-border-width));
$row-border-style: var(--igx-row-border-style, var(--header-border-style));
$row-border-color: var(--igx-row-border-color, var(--header-border-color));
$row-odd-background: var(--igx-row-odd-background, var(--row-odd-background));
$row-odd-text-color: var(--igx-row-odd-text-color, var(--row-odd-text-color));
$row-even-background: var(--igx-row-even-background, var(--row-even-background));
$row-even-text-color: var(--igx-row-even-text-color, var(--row-even-text-color));
$row-hover-background: var(--igx-row-hover-background, var(--row-hover-background));
$row-hover-text-color: var(--igx-row-hover-text-color, var(--row-hover-text-color));
$theme: $material;

:host {
display: grid;
width: 100%;
min-height: $ig-cells-min-height;
border-block-end: $row-border-width $row-border-style $row-border-color;
background: $row-odd-background;
color: $row-odd-text-color;
border-block-end: rem(1px) solid var-get($theme, 'row-border-color');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use --row-border-style and --row-border-width as before, instead of hardcoded values.

Copy link
Contributor Author

@desig9stein desig9stein Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grid schema does not contain those props

background: var-get($theme, 'content-background');
color: var-get($theme, 'row-odd-text-color');
z-index: var(--z-index-base);
}

:host(:last-of-type) {
border-bottom: 0;
}

:host(:nth-of-type(odd)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the odd colors here.

background: var-get($theme, 'row-odd-background');
color: var-get($theme, 'row-odd-text-color');
}

:host(:nth-of-type(even)) {
background: $row-even-background;
color: $row-even-text-color;
background: var-get($theme, 'row-even-background');
color: var-get($theme, 'row-even-text-color');
}

:host(:hover) {
background: $row-hover-background;
color: $row-hover-text-color;
background: var-get($theme, 'row-hover-background');
color: var-get($theme, 'row-hover-text-color');
}
20 changes: 9 additions & 11 deletions src/styles/filter-row/filter-row.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
@use '../common' as *;
@use '../themes/light/themes' as *;

$filtering-row-background: var(--igx-filtering-row-background, var(--filtering-row-background));
$filtering-row-text-color: var(--igx-filtering-row-text-color, var(--filtering-row-text-color));
$header-background: var(--igx-header-background, var(--header-background));
$header-text-color: var(--igx-header-text-color, var(--header-text-color));
$header-border-width: var(--igx-header-border-width, var(--header-border-width));
$header-border-style: var(--igx-header-border-style, var(--header-border-style));
$header-border-color: var(--igx-header-border-color, var(--header-border-color));
$theme: $material;
$filtering-row-background: var-get($theme, 'filtering-row-background');
$filtering-row-text-color: var-get($theme, 'filtering-row-text-color');
$border: var-get($theme, 'header-border-width') var-get($theme, 'header-border-style') var-get($theme, 'header-border-color');

:host {
--ig-size: 1;

display: grid;
grid-row: filter-row;
min-height: $ig-cells-min-height;
background: $header-background;
color: $header-text-color;
border-block-end: $header-border-width $header-border-style $header-border-color;
background: var-get($theme, 'header-background');
color: var-get($theme, 'header-text-color');
border-block-end: $border;
z-index: var(--z-index-base);
padding-inline-end: var(--scrollbar-offset);
}
Expand All @@ -28,7 +26,7 @@ $header-border-color: var(--igx-header-border-color, var(--header-border-color))
padding: 0 $ig-cells-padding;
background: $filtering-row-background;
color: $filtering-row-text-color;
border-inline-end: $header-border-width $header-border-style $header-border-color;
border-inline-end: $border;
}

[part~='active-state'] {
Expand Down
Loading