Skip to content

Commit 0ad9206

Browse files
committed
Moved styles dir under basic_catalog; renamed function.
1 parent fd0eb00 commit 0ad9206

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

renderers/web_core/src/v0_9/basic_catalog/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ export * from './expressions/expression_parser.js';
1818
export * from './functions/basic_functions.js';
1919
export * from './functions/basic_functions_api.js';
2020
export * from './components/basic_components.js';
21+
export {injectBasicCatalogStyles} from './styles/default.js';

renderers/web_core/src/v0_9/styles/default.ts renamed to renderers/web_core/src/v0_9/basic_catalog/styles/default.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,22 @@ function getDefaultStyleSheet(): CSSStyleSheet {
115115
}
116116

117117
/**
118-
* Injects the default A2UI theme variables into the document.
118+
* Injects CSS variables for the A2UI basic catalog into the document.
119119
*
120-
* This method is used by the A2UI-provided basic catalogs of each renderer,
121-
* as needed, so design token values can be shared across all of them.
120+
* This method is used by the A2UI-provided basic catalogs of each renderer
121+
* so design token values can be shared across all of them.
122122
*
123-
* End users may redefine the CSS variables defined in the default stylesheet
124-
* to customize the theme.
123+
* It is only meant to be used by the basic catalog implementations provided
124+
* by `@a2ui/lit`, `@a2ui/angular` and `@a2ui/react`, and should not be
125+
* considered as part of the A2UI spec. This package is just a convenient
126+
* location for it.
125127
*
126-
* This method ensures the default stylesheet is added to the root document
127-
* of the page, if it's not already present.
128+
* Users may redefine the values of the CSS variables exposed in the default
129+
* stylesheet above (and the specific ones exposed by each basic catalog
130+
* package) to customize the appearance of the items of the basic catalog.
128131
*/
129-
export function injectDefaultA2uiTheme() {
130-
if (typeof document === "undefined") return;
132+
export function injectBasicCatalogStyles() {
133+
if (typeof document === 'undefined') return;
131134
const sheet = getDefaultStyleSheet();
132135
if (!document.adoptedStyleSheets.includes(sheet)) {
133136
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];

renderers/web_core/src/v0_9/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export * from './state/surface-components-model.js';
3535
export * from './state/surface-group-model.js';
3636
export * from './state/surface-model.js';
3737
export * from './errors.js';
38-
export { injectDefaultA2uiTheme } from './styles/default.js';
3938

4039
export {effect, Signal, signal} from '@preact/signals-core';
4140

0 commit comments

Comments
 (0)