Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename Theme to GlobalTheme #1702

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gregorw
Copy link
Contributor

@gregorw gregorw commented Mar 24, 2023

Carbon Design System v11 provides the idea of inline theming. As was mentioned in #1648 the Carbon standard implementation is documented here. It says:

The GlobalTheme and Theme components allow you to specify the theme for a page, or for a part of a page, respectively. Theme is most often used to implement inline theming where you can style a portion of your page with a particular theme.

What this means for carbon-components-svelte is that we should rename the existing Theme component to GlobalTheme. This leads us a tiny bit closer to feature parity with Carbon v11 and gives room for a new component dedicated to v11 inline theming.

The reason for this is that Theme is a new v11 component that allows for inline theming. That’s a different purpose than this component has. In the standard Carbon implementation a GlobalTheme is used that matches the purpose of what this Svelte component used to do. The idea is to stick to the same name as the standard implementation.
Carbon Design System provides the idea of [inline theming](https://carbondesignsystem.com/guidelines/color/implementation/#how-inline-theming-works). As was mentioned in carbon-design-system#1648 the Carbon standard implementation is [documented here](https://react.carbondesignsystem.com/?path=/docs/components-theme--playground). It says:

> The `GlobalTheme` and `Theme` components allow you to specify the theme for a page, or for a part of a page, respectively. `Theme` is most often used to implement inline theming where you can style a portion of your page with a particular theme.

What this means for `carbon-components-svelte` is that we should rename the existing `Theme` component to `GlobalTheme`. This leads us a tiny bit closer to [feature parity with Carbon v11](carbon-design-system#1614) and gives room for a new component dedicated to v11 inline theming.
@gregorw gregorw force-pushed the refactor/theme-to-global-theme branch from fed11bc to 67271b9 Compare March 26, 2023 11:44
@metonym metonym force-pushed the master branch 2 times, most recently from e7485c4 to 417102d Compare November 8, 2023 03:27
gregorw added a commit to gregorw/carbon-components-svelte that referenced this pull request Jan 20, 2024
This fixes the current `Theme` component. Note that the canonical implementation uses `GlobalTheme` for the same concept. See carbon-design-system#1702.

Static CSS files are updated to use @carbon/styles including fonts via CDN.

(cherry picked from commit 50f24b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant