Skip to content

Commit ddd0a0b

Browse files
authored
Merge pull request #993 from IgniteUI/didimmova/update-grid-lite-styling-sample
feat(grid-lite): update styling sample to use sass theme
2 parents 27dfeaa + 6ae44e5 commit ddd0a0b

8 files changed

Lines changed: 882 additions & 413 deletions

File tree

browser/package-lock.json

Lines changed: 842 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

browser/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"igniteui-grid-lite": "^0.0.1",
2828
"igniteui-react": "^19.4.0",
2929
"igniteui-react-charts": "19.3.1",
30+
"igniteui-theming": "^24.0.2",
3031
"igniteui-react-core": "19.3.1",
3132
"igniteui-react-dashboards": "19.3.1",
3233
"igniteui-react-data-grids": "19.3.1",
@@ -96,6 +97,7 @@
9697
"remark": "^14.0.2",
9798
"remark-frontmatter": "^2.0.0",
9899
"run-sequence": "^2.2.1",
100+
"sass-embedded": "^1.84.0",
99101
"ts-loader": "^9.5.4",
100102
"ts-node": "^10.9.2",
101103
"typescript": "^4.8.4",

browser/vite.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ export default defineConfig(({ mode }) => ({
3030
'jszip/dist/jszip'
3131
],
3232
},
33+
css: {
34+
preprocessorOptions: {
35+
scss: {
36+
includePaths: ['node_modules'],
37+
loadPaths: [resolve(__dirname, 'node_modules')]
38+
}
39+
}
40+
},
3341
build: {
3442
outDir: 'build',
3543
commonjsOptions: {

samples/grids/grid-lite/styling-custom-theme/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dependencies": {
1717
"igniteui-grid-lite": "^0.0.1",
1818
"igniteui-react": "^19.4.0",
19+
"igniteui-theming": "^24.0.2",
1920
"igniteui-webcomponents": "^6.3.0",
2021
"lit-html": "^3.2.0",
2122
"react": "^19.2.0",
@@ -30,6 +31,7 @@
3031
"@vitejs/plugin-react": "^5.0.4",
3132
"@vitest/browser": "^3.2.4",
3233
"eslint": "^8.33.0",
34+
"sass": "^1.83.0",
3335
"eslint-config-react": "^1.1.7",
3436
"eslint-plugin-react": "^7.20.0",
3537
"typescript": "^4.8.4",

samples/grids/grid-lite/styling-custom-theme/src/index.css

Lines changed: 0 additions & 405 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@use 'igniteui-theming' as *;
2+
@import 'igniteui-theming/sass/typography/presets';
3+
4+
$custom-palette: palette(
5+
$primary: #ddd020,
6+
$secondary: #d5896f,
7+
$surface: #031d44,
8+
$gray: #04395e,
9+
);
10+
11+
.grid-lite-wrapper {
12+
width: 100%;
13+
height: 100%;
14+
}
15+
16+
.custom-styled {
17+
@include palette($custom-palette);
18+
@include typography('"Merriweather Sans", sans-serif', $bootstrap-type-scale);
19+
}

samples/grids/grid-lite/styling-custom-theme/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from 'igniteui-webcomponents';
1111

1212
import "igniteui-webcomponents/themes/light/bootstrap.css";
13-
import "./index.css";
13+
import "./index.scss";
1414

1515
// Register components
1616
IgcGridLite.register();

samples/grids/grid-lite/styling-custom-theme/vite.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
3+
import { resolve } from 'path';
34

45
export default defineConfig({
56
plugins: [react()],
7+
css: {
8+
preprocessorOptions: {
9+
scss: {
10+
loadPaths: [resolve(__dirname, 'node_modules')]
11+
}
12+
}
13+
},
614
build: {
715
outDir: 'build'
816
},

0 commit comments

Comments
 (0)