Skip to content

Commit f879c82

Browse files
authored
Merge pull request #1118 from IgniteUI/didimmova/update-grid-lite-styling-sample
feat(grid-lite): use sass for styling the grid-lite component
2 parents a4b88bc + 7eee789 commit f879c82

7 files changed

Lines changed: 95 additions & 453 deletions

File tree

package-lock.json

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

samples/grids/grid-lite/styling-custom-theme/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<meta charset="UTF-8" />
66
<link rel="shortcut icon" href="https://dl.infragistics.com/x/img/browsers/wc.png" >
77
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@400;500;700&display=swap" />
9+
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" />
810
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" />
911
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" />
1012
<link rel="stylesheet" href="https://dl.infragistics.com/x/css/samples/shared.v8.css" />

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
"file-loader": "^6.2.0",
4545
"fork-ts-checker-webpack-plugin": "^9.1.0",
4646
"html-webpack-plugin": "^5.6.4",
47+
"igniteui-theming": "^24.0.2",
4748
"parcel-bundler": "^1.12.5",
49+
"sass": "^1.96.0",
50+
"sass-loader": "^16.0.6",
4851
"source-map": "^0.7.6",
4952
"style-loader": "^4.0.0",
5053
"tsconfig-paths-webpack-plugin": "^4.2.0",
@@ -55,4 +58,4 @@
5558
"worker-loader": "^3.0.8",
5659
"xml-loader": "^1.2.1"
5760
}
58-
}
61+
}

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+
@use '../node_modules/igniteui-theming/sass/typography/presets/bootstrap' as bootstrap;
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.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineComponents, IgcRatingComponent } from 'igniteui-webcomponents';
33
import { GridLiteDataService, ProductInfo } from './GridLiteDataService';
44

55
import "igniteui-webcomponents/themes/light/bootstrap.css";
6-
import "./index.css";
6+
import "./index.scss";
77

88
IgcGridLite.register();
99
defineComponents(IgcRatingComponent);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ module.exports = env => {
5454
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
5555
{ test: /\.xml$/, use: ['xml-loader'] },
5656
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
57+
{
58+
test: /\.scss$/,
59+
sideEffects: true,
60+
use: [
61+
'style-loader',
62+
'css-loader',
63+
{
64+
loader: 'sass-loader',
65+
options: {
66+
sassOptions: {
67+
silenceDeprecations: ['color-functions', 'if-function'],
68+
}
69+
}
70+
}
71+
]
72+
},
5773
{
5874
test: /worker\.(ts|js)$/,
5975
use: [

0 commit comments

Comments
 (0)