Skip to content

Commit d24ccf1

Browse files
refactor(gotchas): remove Sass conflicts sections
1 parent 90a4c01 commit d24ccf1

1 file changed

Lines changed: 7 additions & 40 deletions

File tree

  • skills/igniteui-react-generate-from-image-design/reference

skills/igniteui-react-generate-from-image-design/reference/gotchas.md

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,13 @@
11
# Ignite UI React Gotchas & Pitfalls
22

33
## Table of Contents
4-
- [Sass Conflicts](#sass-conflicts)
54
- [React Wrappers & CSS Selectors](#react-wrappers--css-selectors)
65
- [Chart Properties](#chart-properties)
76
- [Component Properties](#component-properties)
87
- [Theming Pitfalls](#theming-pitfalls)
98
- [Map Component](#map-component)
109
- [Dark Theme Specifics](#dark-theme-specifics)
1110

12-
## Sass Conflicts
13-
14-
### `contrast()` function collision
15-
The CSS `contrast()` filter function can collide with `igniteui-theming`'s `contrast()` Sass function. When you need the native CSS function, call it explicitly via `sass:meta`:
16-
```scss
17-
@use "sass:meta";
18-
19-
.uses-css-contrast {
20-
filter: meta.call(meta.get-function("contrast", $css: true), <contrast-value>);
21-
}
22-
```
23-
Prefer this approach over string escaping when a native CSS function name collides with a Sass function.
24-
25-
### Font family in typography mixin
26-
Comma-separated font families are parsed as multiple Sass arguments. Wrap in parentheses:
27-
```scss
28-
// BAD
29-
@include typography($font-family: "Primary Font", "Fallback Font", sans-serif);
30-
31-
// GOOD
32-
@include typography($font-family: ("Primary Font", "Fallback Font", sans-serif));
33-
```
34-
Replace `"Primary Font"` and `"Fallback Font"` with the font families extracted from the design image.
35-
3611
## React Wrappers & CSS Selectors
3712

3813
### Use JSX props and children
@@ -108,7 +83,7 @@ For smooth-looking area charts where the data should appear continuous rather th
10883

10984
### Charts inside CSS Grid can collapse
11085
In a flexible CSS Grid track, set `min-height: 0` on the grid cell and make the chart fill its container:
111-
```scss
86+
```css
11287
.chart-panel {
11388
min-height: 0;
11489
}
@@ -146,8 +121,8 @@ import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
146121

147122
Do not remove or replace those imports unless the user explicitly wants a theme variant change.
148123

149-
### DV components do NOT inherit Sass theme colors
150-
Charts, maps, gauges, and sparklines ignore the global Sass theme. Set their visual properties explicitly via component props. After a palette exists, prefer palette tokens or local semantic CSS variables over leaving raw color literals in the final JSX:
124+
### DV components require explicit visual props
125+
Charts, maps, gauges, and sparklines do not use the component-token theme generation flow from this skill. Set their visual properties explicitly via component props. After a palette exists, prefer palette tokens or local semantic CSS variables over leaving raw color literals in the final JSX:
151126
```tsx
152127
<IgrCategoryChart
153128
brushes="<resolved-series-brush>"
@@ -162,15 +137,15 @@ For core UI component theming, prefer `create_component_theme` and apply the ret
162137

163138
### Nav drawer width
164139
Override the drawer width using the nav drawer CSS custom properties measured from the design image:
165-
```scss
140+
```css
166141
igc-nav-drawer {
167142
--ig-nav-drawer-size: <extracted-sidebar-width>;
168143
--ig-nav-drawer-size--mini: <extracted-mini-drawer-width>;
169144
}
170145
```
171146

172147
### Read luminance warnings from theme generation
173-
If `create_theme` returns a luminance warning for a generated surface, do not ignore it. If the design needs multiple surface depths, use `create_custom_palette` or define semantic CSS variables such as `--surface-1` and `--surface-2` in `styles.scss` instead of relying on a single generated surface color.
148+
If `create_theme` returns a luminance warning for a generated surface, do not ignore it. If the design needs multiple surface depths, use `create_custom_palette` or define semantic CSS variables such as `--surface-1` and `--surface-2` in a shared CSS file instead of relying on a single generated surface color.
174149

175150
## Map Component
176151

@@ -197,7 +172,7 @@ useEffect(() => {
197172

198173
### Dark map styling
199174
OpenStreetMap tiles are light by default. For dark themes, apply a CSS filter to the container. Adjust the values to match the map tone in the design image:
200-
```scss
175+
```css
201176
.map-container {
202177
/* tune grayscale (0-1) and brightness (0-1) to match the design */
203178
filter: grayscale(<0-1>) brightness(<0-1>);
@@ -206,18 +181,10 @@ OpenStreetMap tiles are light by default. For dark themes, apply a CSS filter to
206181

207182
## Dark Theme Specifics
208183

209-
### Use the resolved dark schema for dark themes
210-
```scss
211-
@include palette(
212-
$resolved-palette,
213-
$schema: <resolved-dark-schema>
214-
);
215-
```
216-
217184
### CSS custom properties for dark panels
218185
When the design uses multiple dark surface depths (panels, sidebars, cards on a dark background), define reusable semantic tokens using palette references or values derived from the design intent:
219186

220-
```scss
187+
```css
221188
:root {
222189
--surface-primary: <resolved-surface-token>;
223190
--surface-secondary: <resolved-surface-token>;

0 commit comments

Comments
 (0)