Skip to content

Commit 1c5511d

Browse files
fix Material font family to avoid flickering and update Viz elements' styles (#31758)
1 parent 601cfa2 commit 1c5511d

File tree

24 files changed

+53
-53
lines changed

24 files changed

+53
-53
lines changed

packages/devextreme-scss/scss/widgets/fluent/_colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $fluent-color-theme-modificator: null !default;
2222
* $name 10. Font family
2323
* $type text
2424
*/
25-
$base-font-family: segoe ui, -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif !default;
25+
$base-font-family: 'segoe ui', -apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'helvetica neue', 'adwaita sans', cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif !default;
2626

2727
/**
2828
* $name 30. Page background color

packages/devextreme-scss/scss/widgets/generic/_colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $generic-color-postfix: null !default;
1010
* $name 10. Font family
1111
* $type text
1212
*/
13-
$base-font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif !default;
13+
$base-font-family: -apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'segoe ui', 'helvetica neue', 'adwaita sans', cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif !default;
1414

1515
/**
1616
* $name 10. Accent color

packages/devextreme-scss/scss/widgets/material/_colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $material-color-theme-modificator: null !default;
1717
* $name 10. Font family
1818
* $type text
1919
*/
20-
$base-font-family: roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, noto, helvetica, arial, sans-serif !default;
20+
$base-font-family: roboto, 'roboto fallback', -apple-system, BlinkMacSystemFont, 'avenir next', avenir, 'segoe ui', 'helvetica neue', 'adwaita sans', cantarell, ubuntu, noto, helvetica, arial, sans-serif !default;
2121

2222
/**
2323
* $name 20. Text color

packages/devextreme-scss/scss/widgets/material/typography/_index.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@import "https://fonts.googleapis.com/earlyaccess/notokufiarabic.css";
1212

1313
@font-face {
14-
font-family: 'RobotoFallback';
14+
font-family: 'roboto fallback';
1515
font-style: normal;
1616
font-weight: 300;
1717
src:
@@ -23,7 +23,7 @@
2323
}
2424

2525
@font-face {
26-
font-family: 'RobotoFallback';
26+
font-family: 'roboto fallback';
2727
font-style: normal;
2828
font-weight: 400;
2929
src:
@@ -35,7 +35,7 @@
3535
}
3636

3737
@font-face {
38-
font-family: 'RobotoFallback';
38+
font-family: 'roboto fallback';
3939
font-style: normal;
4040
font-weight: 500;
4141
src:
@@ -47,7 +47,7 @@
4747
}
4848

4949
@font-face {
50-
font-family: 'RobotoFallback';
50+
font-family: 'roboto fallback';
5151
font-style: normal;
5252
font-weight: 700;
5353
src:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default `.dx-accordion {
2-
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,adwaita sans,cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
2+
font-family: -apple-system,BlinkMacSystemFont,"avenir next",avenir,"segoe ui","helvetica neue","adwaita sans",cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
33
color: #337ab7;
44
background-image: url(icons/icons.woff2);
55
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const meta: { [key: string]: string } = {
2-
'$base-font-family': "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif",
2+
'$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',
44
'$accordion-title-color': '#337ab7',
55
'$accordion-item-title-opened-bg': 'transparent',

packages/devextreme-themebuilder/tests/data/scss/widgets/generic/_colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $base-accent: null !default;
99

1010

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

1414
$base-accent: #337ab7 !default;
1515
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('Compile manager - integration test on test sass', () => {
5151
outColorScheme: 'test-theme',
5252
}).then((result) => {
5353
expect(result.css).toBe(`.dx-swatch-test-theme .dx-accordion {
54-
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,adwaita sans,cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
54+
font-family: -apple-system,BlinkMacSystemFont,"avenir next",avenir,"segoe ui","helvetica neue","adwaita sans",cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
5555
color: #337ab7;
5656
background-image: url(icons/icons.woff2);
5757
}
@@ -69,7 +69,7 @@ describe('Compile manager - integration test on test sass', () => {
6969
assetsBasePath: 'base-path',
7070
}).then((result) => {
7171
expect(result.css).toBe(`.dx-accordion {
72-
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,adwaita sans,cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
72+
font-family: -apple-system,BlinkMacSystemFont,"avenir next",avenir,"segoe ui","helvetica neue","adwaita sans",cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;
7373
color: #337ab7;
7474
background-image: url(base-path/icons/icons.woff2);
7575
}
@@ -88,7 +88,7 @@ describe('Compile manager - integration test on test sass', () => {
8888
}).then((result) => {
8989
expect(result.css).toBe('');
9090
expect(result.compiledMetadata).toEqual({
91-
"$base-font-family": "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif",
91+
"$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',
9393
});
9494
});
@@ -100,7 +100,7 @@ describe('Compile manager - integration test on test sass', () => {
100100
noClean: true,
101101
}).then((result) => {
102102
expect(result.css).toBe(`.dx-accordion {
103-
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif;
103+
font-family: -apple-system, BlinkMacSystemFont, \"avenir next\", avenir, \"segoe ui\", \"helvetica neue\", \"adwaita sans\", cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif;
104104
color: #337ab7;
105105
background-image: url(icons/icons.woff2);
106106
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const includePaths = [path.join(dataPath, 'scss', 'widgets', 'generic'), path.jo
1818
const file = path.join(dataPath, 'scss', 'bundles', 'dx.light.scss');
1919

2020
const expectedCss = ({
21-
fontFamily = '-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, adwaita sans, cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif',
21+
fontFamily = '-apple-system, BlinkMacSystemFont, "avenir next", avenir, "segoe ui", "helvetica neue", "adwaita sans", cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif',
2222
color = '#337ab7',
2323
bgColor = 'transparent'
2424
} = {}) => `.dx-accordion {
@@ -118,7 +118,7 @@ describe('compile', () => {
118118
// compiled css
119119
expect(data.result.css.toString()).toBe(
120120
'.dx-accordion{font-family:'
121-
+ '-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,adwaita sans,cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;'
121+
+ '-apple-system,BlinkMacSystemFont,"avenir next",avenir,"segoe ui","helvetica neue","adwaita sans",cantarell,ubuntu,roboto,noto,helvetica,arial,sans-serif;'
122122
+ 'color:#337ab7;background-image:url(icons/icons.woff2)}.dx-accordion '
123123
+ '.from-base{background-color:transparent;color:#337ab7}.extra-class{color:red}',
124124
);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ describe('PreCompiler', () => {
2424
line-height: normal;
2525
}
2626
@font-face {
27-
font-family: RobotoFallback;
27+
font-family: roboto fallback;
2828
font-style: normal;
2929
font-weight: 300;
3030
src: local("Roboto Light"),local("Roboto-Light"),url(fonts/Roboto-300.woff2) format("woff2"),url(fonts/Roboto-300.woff) format("woff"),url(fonts/Roboto-300.ttf) format("truetype");
3131
}
3232
@font-face {
33-
font-family: RobotoFallback;
33+
font-family: roboto fallback;
3434
font-style: normal;
3535
font-weight: 400;
3636
src: local("Roboto"),local("Roboto-Regular"),url(fonts/Roboto-400.woff2) format("woff2"),url(fonts/Roboto-400.woff) format("woff"),url(fonts/Roboto-400.ttf) format("truetype");
@@ -40,20 +40,20 @@ describe('PreCompiler', () => {
4040
color: rgba(0,0,0,.87);
4141
font-weight: 400;
4242
font-size: 14px;
43-
font-family: Roboto,RobotoFallback,"Noto Kufi Arabic",Helvetica,Arial,sans-serif;
43+
font-family: roboto,"roboto fallback","Noto Kufi Arabic",helvetica,arial,sans-serif;
4444
line-height: 1.2857;
4545
}`;
4646

4747
const expectedCss = `@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700);
4848
@import "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700";
4949
@font-face {
50-
font-family: RobotoFallback;
50+
font-family: roboto fallback;
5151
font-style: normal;
5252
font-weight: 300;
5353
src: local("Roboto Light"),local("Roboto-Light"),url(fonts/Roboto-300.woff2) format("woff2"),url(fonts/Roboto-300.woff) format("woff"),url(fonts/Roboto-300.ttf) format("truetype");
5454
}
5555
@font-face {
56-
font-family: RobotoFallback;
56+
font-family: roboto fallback;
5757
font-style: normal;
5858
font-weight: 400;
5959
src: local("Roboto"),local("Roboto-Regular"),url(fonts/Roboto-400.woff2) format("woff2"),url(fonts/Roboto-400.woff) format("woff"),url(fonts/Roboto-400.ttf) format("truetype");
@@ -70,7 +70,7 @@ describe('PreCompiler', () => {
7070
color: rgba(0,0,0,.87);
7171
font-weight: 400;
7272
font-size: 14px;
73-
font-family: Roboto,RobotoFallback,"Noto Kufi Arabic",Helvetica,Arial,sans-serif;
73+
font-family: roboto,"roboto fallback","Noto Kufi Arabic",helvetica,arial,sans-serif;
7474
line-height: 1.2857;
7575
} };`;
7676
const swatchSass = createSassForSwatch('test-theme-name', sourceCss);

0 commit comments

Comments
 (0)