Skip to content

Commit db375d3

Browse files
nnaydenowpskelin
andauthored
Revert "feat(framework): introduce loadBaseThemingCSSVariables configuration (#12699)" (#12767)
This reverts commit f01b2eb. Co-authored-by: Peter Skelin <[email protected]>
1 parent 35ae11a commit db375d3

File tree

14 files changed

+33
-176
lines changed

14 files changed

+33
-176
lines changed

docs/2-advanced/01-configuration.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ There are several configuration settings that affect all UI5 Web Components glob
1515
| [secondaryCalendarType](#calendarType) | `Gregorian`, `Islamic`, `Buddhist`, `Japanese`, `Persian` | `undefined` | Default secondary calendar type to be used for date-related components | Date/time components (`ui5-date-picker`, etc.) |
1616
| [noConflict](#noConflict) | `true`, `false` | `false` | When set to true, all events will be fired with a `ui5-` prefix only | Components that fire events (most do) |
1717
| [formatSettings](#formatSettings) | See the [Format settings](#formatSettings) section below | `{}` | Allows to override locale-specific configuration | Date/time components (`ui5-date-picker`, etc.) |
18-
| [loadBaseThemingCSSVariables](#loadBaseThemingCSSVariables) | `true`, `false` | `true` | Whether to load CSS variables from `@sap-theming/theming-base-content` package | Framework |
1918
| [fetchDefaultLanguage](#fetchDefaultLanguage) | `true`, `false` | `false` | Whether to fetch assets even for the default language | Framework |
2019
| [defaultFontLoading](#defaultFontLoading) | `true`, `false` | `true` | Whether to fetch default font faces | Framework |
2120
| [enableDefaultTooltips](#enableDefaultTooltips) | `true`, `false` | `true` | Whether to display default tooltips | Components (Icon, Button, RatingIndicator, etc.) |
@@ -220,23 +219,6 @@ Example:
220219
}
221220
</script>
222221
```
223-
224-
### loadBaseThemingCSSVariables
225-
<a name="loadBaseThemingCSSVariables"></a>
226-
227-
This configuration option controls whether the framework should load the CSS variables from `@sap-theming/theming-base-content` package.
228-
229-
Typically, you would not need to modify this setting. However, if your application provides its **own** instance or version of `@sap-theming/theming-base-content` and you prefer the framework **not** to load the built-in base theming CSS variables, you can set `loadBaseThemingCSSVariables` to `false`.
230-
231-
Example:
232-
```html
233-
<script data-ui5-config type="application/json">
234-
{
235-
"loadBaseThemingCSSVariables": false
236-
}
237-
</script>
238-
```
239-
240222
### defaultFontLoading
241223
<a name="defaultFontLoading"></a>
242224

packages/base/src/InitialConfiguration.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type InitialConfig = {
2424
formatSettings: FormatSettings,
2525
fetchDefaultLanguage: boolean,
2626
defaultFontLoading: boolean,
27-
loadBaseThemingCSSVariables: boolean,
2827
enableDefaultTooltips: boolean,
2928
};
3029

@@ -41,7 +40,6 @@ let initialConfig: InitialConfig = {
4140
formatSettings: {},
4241
fetchDefaultLanguage: false,
4342
defaultFontLoading: true,
44-
loadBaseThemingCSSVariables: true,
4543
enableDefaultTooltips: true,
4644
};
4745

@@ -96,11 +94,6 @@ const getDefaultFontLoading = () => {
9694
return initialConfig.defaultFontLoading;
9795
};
9896

99-
const getLoadBaseThemingCSSVariables = () => {
100-
initConfiguration();
101-
return initialConfig.loadBaseThemingCSSVariables;
102-
};
103-
10497
const getEnableDefaultTooltips = () => {
10598
initConfiguration();
10699
return initialConfig.enableDefaultTooltips;
@@ -262,7 +255,6 @@ export {
262255
getTimezone,
263256
getFormatSettings,
264257
getDefaultFontLoading,
265-
getLoadBaseThemingCSSVariables,
266258
resetConfiguration,
267259
getEnableDefaultTooltips,
268260
};

packages/base/src/config/Theme.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getTheme as getConfiguredTheme, getLoadBaseThemingCSSVariables as getConfiguredLoadBaseThemingCSSVariables } from "../InitialConfiguration.js";
1+
import { getTheme as getConfiguredTheme } from "../InitialConfiguration.js";
22
import { reRenderAllUI5Elements } from "../Render.js";
33
import applyTheme from "../theming/applyTheme.js";
44
import getThemeDesignerTheme from "../theming/getThemeDesignerTheme.js";
@@ -7,7 +7,6 @@ import { boot, isBooted } from "../Boot.js";
77
import { attachConfigurationReset } from "./ConfigurationReset.js";
88

99
let curTheme: string | undefined;
10-
let loadBaseThemingCSSVariables: boolean | undefined;
1110

1211
attachConfigurationReset(() => {
1312
curTheme = undefined;
@@ -58,36 +57,6 @@ const getDefaultTheme = (): string => {
5857
return DEFAULT_THEME;
5958
};
6059

61-
/**
62-
* Returns the current configuration for loading base theming CSS variables.
63-
*
64-
* @public
65-
* @since 2.17.0
66-
* @returns {boolean}
67-
*/
68-
const getLoadBaseThemingCSSVariables = () => {
69-
if (loadBaseThemingCSSVariables === undefined) {
70-
loadBaseThemingCSSVariables = getConfiguredLoadBaseThemingCSSVariables();
71-
}
72-
73-
return loadBaseThemingCSSVariables;
74-
};
75-
76-
/**
77-
* Configures whether to load base theming CSS variables.
78-
*
79-
* - When set to `true` (default), base theming CSS variables are loaded.
80-
* - When set to `false`, base theming CSS variables are not loaded.
81-
*
82-
* **Note:** This method should be called before the boot process.
83-
*
84-
* @public
85-
* @since 2.17.0
86-
*/
87-
const setLoadBaseThemingCSSVariables = (value: boolean) => {
88-
loadBaseThemingCSSVariables = value;
89-
};
90-
9160
/**
9261
* Returns if the given theme name is the one currently applied.
9362
* @private
@@ -129,6 +98,4 @@ export {
12998
isLegacyThemeFamily,
13099
isLegacyThemeFamilyAsync,
131100
getDefaultTheme,
132-
getLoadBaseThemingCSSVariables,
133-
setLoadBaseThemingCSSVariables,
134101
};

packages/base/src/theming/applyTheme.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { fireThemeLoaded } from "./ThemeLoaded.js";
55
import { attachCustomThemeStylesToHead, getThemeRoot } from "../config/ThemeRoot.js";
66
import { DEFAULT_THEME } from "../generated/AssetParameters.js";
77
import { getCurrentRuntimeIndex } from "../Runtimes.js";
8-
import { getLoadBaseThemingCSSVariables } from "../config/Theme.js";
98

109
// eslint-disable-next-line
1110
export let _lib = "ui5";
@@ -34,10 +33,6 @@ const loadComponentPackages = async (theme: string, externalThemeName?: string)
3433
const registeredPackages = getRegisteredPackages();
3534

3635
const packagesStylesPromises = [...registeredPackages].map(async packageName => {
37-
if (getLoadBaseThemingCSSVariables() !== true && packageName === `${BASE_THEME_PACKAGE}-raw`) {
38-
return;
39-
}
40-
4136
if (packageName === BASE_THEME_PACKAGE) {
4237
return;
4338
}

packages/compat/cypress/specs/Table.cy.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ describe("Table general interaction", () => {
509509
cy.get("@popinChange")
510510
.should(stub => {
511511
expect(stub).to.have.been.calledTwice;
512+
debugger
512513
// @ts-ignore
513514
expect(stub.args.slice(-1)[0][0].detail.poppedColumns.length).to.equal(2);
514515
})

packages/main/src/bundle.common.bootstrap.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,7 @@ import { resetConfiguration } from "@ui5/webcomponents-base/dist/InitialConfigur
6060
import { sanitizeHTML, URLListValidator } from "@ui5/webcomponents-base/dist/util/HTMLSanitizer.js";
6161

6262
import { getAnimationMode, setAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js";
63-
import {
64-
getTheme,
65-
setTheme,
66-
isLegacyThemeFamily,
67-
getLoadBaseThemingCSSVariables,
68-
setLoadBaseThemingCSSVariables,
69-
} from "@ui5/webcomponents-base/dist/config/Theme.js";
63+
import { getTheme, setTheme, isLegacyThemeFamily } from "@ui5/webcomponents-base/dist/config/Theme.js";
7064
import { getThemeRoot, setThemeRoot } from "@ui5/webcomponents-base/dist/config/ThemeRoot.js";
7165
import { getTimezone, setTimezone } from "@ui5/webcomponents-base/dist/config/Timezone.js";
7266
import { getLanguage, setLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
@@ -110,8 +104,6 @@ const testAssets = {
110104
getFirstDayOfWeek,
111105
getTimezone,
112106
setTimezone,
113-
getLoadBaseThemingCSSVariables,
114-
setLoadBaseThemingCSSVariables,
115107
},
116108
invisibleMessage: {
117109
announce,

packages/main/test/pages/theming/Themes7.html

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/main/test/pages/theming/Themes8.html

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/theming/package-scripts.cjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ module.exports = {
2424
src: `ui5nps-script "${TOOLS_LIB}copy-and-watch/index.js" "src/**/*.{json}" dist/`,
2525
typescript: "tsc",
2626
postcss: `ui5nps-script "${TOOLS_LIB}/css-processors/css-processor-themes.mjs"`,
27-
jsonImports: {
28-
default: "ui5nps build.jsonImports.scoped build.jsonImports.raw",
29-
scoped: `ui5nps-script "${jsonImportsScript}" src/themes src/generated/json-imports`,
30-
raw: `ui5nps-script "${jsonImportsScript}" src/themes src/generated/json-imports -raw`,
31-
}
27+
jsonImports: `ui5nps-script "${jsonImportsScript}" src/themes src/generated/json-imports`,
3228
},
3329
generateReport: `ui5nps-script "${generateReportScript}"`,
3430
},
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
// The theming package provides theming assets only
22
import "./generated/json-imports/Themes-fetch.js";
3-
import "./generated/json-imports/Themes-raw-fetch.js";

0 commit comments

Comments
 (0)