-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit copies the shim from `@cds/core@6.2.5` to `@clr/ui`. We are moving the shim to the `@clr/ui` package to allow both to be evolved together. Otherwise, changes to the custom property API exposed by `@clr/ui` will require changes in a separate package (and separate repo). This would cause version synchronization difficulties. How to update: The file path in applications should be updated as follows: '@cds/core/styles/shim.clr-ui.min.css' -> '@clr/ui/shim.cds-core.min.css' That's it, just a simple find and replace.
- Loading branch information
1 parent
9436eab
commit c7c51e5
Showing
6 changed files
with
853 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Meta } from '@storybook/addon-docs'; | ||
|
||
<Meta title="cds-core shim" /> | ||
|
||
# @cds/core shim | ||
|
||
Clarity provides a theme the enables `@clr/ui` applications to consume the Clarity Core design | ||
tokens and theme system. Once installed, `@clr/ui` applications will be able to use all Clarity Core | ||
color themes available today, in particular the color contrast adjustments in the light and dark | ||
themes. The shim maps colors to the `@cds/core` design token system. Typography and spacing are | ||
not affected. If your application does not use `@clr/ui`, this shim is not needed. | ||
|
||
Follow the [Getting Started](https://storybook.core.clarity.design/?path=/story/documentation-getting-started--page) | ||
directions for Clarity Core, including loading the relevant CSS files and setting the `cds-theme` | ||
attribute on the body tag. The shim will not be applied to `@clr/ui` or `@clr/angular` components | ||
without this attribute. | ||
|
||
Import and load the CSS shim file last after `@clr/ui` global CSS. This will ensure that the shim can | ||
override the `@clr/ui` values appropriately. | ||
|
||
```css | ||
@import 'modern-normalize/modern-normalize.css'; | ||
@import '@cds/core/global.min.css'; // provides the Clarity Core design tokens | ||
@import '@cds/core/styles/theme.dark.min.css'; // to allow dark mode with cds-theme="dark" | ||
@import '@clr/ui/clr-ui.min.css'; // @clr/ui CSS (this should already be imported by your application) | ||
@import '@cds/ui/shim.cds-core.min.css'; // the shim file | ||
``` | ||
|
||
## Dark Mode | ||
|
||
Clarity Core's dark mode should replace the `@clr/ui` dark mode. Remove any reference to the `@clr/ui` | ||
dark mode file from the source code and toggle dark mode by changing the `cds-theme` attribute to "dark." | ||
|
||
## Adoption | ||
|
||
We fully support the `@cds/core` shim as the path forward for ng-clarity. But we need your help. The | ||
shim is currently optional, but the only way to improve the Shim is to get feedback from teams as | ||
they adopt it in their projects/products. We recomend new projects to use the shim from the start. | ||
For existing projects, we ask teams to start adopting it to help us test it and provide feedback. | ||
|
||
Our goal is mature the shim to a point where it can be the default (and later the only) option for | ||
theming Clarity. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.