Skip to content

Commit 285381b

Browse files
fix: Theme Builder - recover from sass update (DevExpress#32227)
1 parent 241c801 commit 285381b

File tree

9 files changed

+233
-10
lines changed

9 files changed

+233
-10
lines changed

packages/devextreme-scss/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"gulp-sass": "6.0.1",
1313
"gulp-shell": "0.8.0",
1414
"minimist": "1.2.8",
15-
"sass-embedded": "1.97.1",
15+
"sass-embedded": "1.93.3",
1616
"stylelint": "15.11.0",
1717
"stylelint-config-standard-scss": "9.0.0",
1818
"stylelint-scss": "6.10.0",

packages/devextreme-themebuilder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"autoprefixer": "^10.4.21",
2828
"clean-css": "^5.3.0",
2929
"postcss": "^8.2.6",
30-
"sass-embedded": "1.97.1"
30+
"sass-embedded": "1.93.3"
3131
},
3232
"devDependencies": {
3333
"@types/clean-css": "4.2.11",

packages/devextreme-themebuilder/src/modules/parse-value.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import * as sass from 'sass-embedded';
22

33
export const color = (value: sass.SassColor): string => {
4-
const getHex = (colorValue: number): string => colorValue.toString(16).padStart(2, '0');
4+
const getHex = (colorValue: number): string => {
5+
const n = Math.max(0, Math.min(255, Math.round(colorValue)));
6+
7+
return n.toString(16).padStart(2, '0');
8+
};
59

610
const alpha = Math.round(255 * value.alpha);
711
if (alpha === 0) {

packages/devextreme-themebuilder/tests/data/compilation-results/no-changes-meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const meta: { [key: string]: string } = {
22
'$base-font-family': "-apple-system, BlinkMacSystemFont, \"avenir next\", avenir, \"segoe ui\", \"helvetica neue\", \"adwaita sans\", cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif",
33
'$base-accent': '#337ab7',
4+
'$float-channel-color': '#2d6da3',
45
'$accordion-title-color': '#337ab7',
56
'$accordion-item-title-opened-bg': 'transparent',
67
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
$base-font-family: getCustomVar(("$base-font-family")) !default;
22
$base-accent: getCustomVar(("$base-accent")) !default;
3+
$float-channel-color: getCustomVar(("$float-channel-color")) !default;
34

45
@use "sass:color";
56
$color: null !default;
67

78
$base-font-family: null !default;
89
$base-accent: null !default;
10+
$float-channel-color: null !default;
911

1012

1113
@if $color == "light" {
1214
$base-font-family: -apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'segoe ui', 'helvetica neue', 'adwaita sans', cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif !default;
1315

1416
$base-accent: #337ab7 !default;
17+
$float-channel-color: color.adjust($base-accent, $lightness: -5%, $space: hsl) !default;
1518
}
1619

1720

1821
$never-used: collector(
1922
(
2023
"$base-font-family": $base-font-family,
2124
"$base-accent": $base-accent,
25+
"$float-channel-color": $float-channel-color,
2226
12345: "",
2327
)
2428
);

packages/devextreme-themebuilder/tests/modules/compile-manager.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ describe('Compile manager - integration test on test sass', () => {
9090
expect(result.compiledMetadata).toEqual({
9191
"$base-font-family": "-apple-system, BlinkMacSystemFont, \"avenir next\", avenir, \"segoe ui\", \"helvetica neue\", \"adwaita sans\", cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif",
9292
'$base-accent': '#337ab7',
93+
'$float-channel-color': '#2d6da3',
9394
});
9495
});
9596
});

packages/devextreme-themebuilder/tests/modules/compiler.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ describe('compile', () => {
8686
'$base-font-family': '"Segoe UI", helvetica, verdana, sans-serif',
8787
'$base-accent': '#ff0000',
8888
'$accordion-title-color': '#ff0000',
89+
'$float-channel-color': '#e60000',
8990
'$accordion-item-title-opened-bg': '#008000',
9091
});
9192
});

packages/devextreme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
"react-dom": "16.14.0",
189189
"react-test-renderer": "16.14.0",
190190
"recast": "0.23.4",
191-
"sass-embedded": "1.97.1",
191+
"sass-embedded": "1.93.3",
192192
"shelljs": "0.8.5",
193193
"sinon": "18.0.1",
194194
"staged-git-files": "1.3.0",

0 commit comments

Comments
 (0)