Skip to content
Discussion options

You must be logged in to vote

This usually happens if the theme provider or styles package isn’t set up correctly, so the CSS custom properties don’t get injected. A few things to check:

  1. Import the CSS reset and theme tokens
    Make sure you’ve imported the core styles in your entry point (e.g. index.js or App.js):

    import '@carbon/styles/css/styles.css';

    or if you’re using Sass:

    @use '@carbon/styles';

    Without this, the --cds-* tokens (like --cds-label-02 or --cds-heading-01) won’t be defined.

  2. Use the Theme component (React)
    Wrap your app or a section of it with the Carbon Theme component to ensure the right theme context is applied:

    import { Theme } from '@carbon/react';
    
    function App() {
      return (
        <Theme theme="…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tay1orjones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants