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

[Bug]: Theming and nested rules #2571

Closed
2 tasks done
hausdora opened this issue Aug 15, 2024 · 2 comments · Fixed by #2638
Closed
2 tasks done

[Bug]: Theming and nested rules #2571

hausdora opened this issue Aug 15, 2024 · 2 comments · Fixed by #2638
Assignees
Labels
bug Something isn't working

Comments

@hausdora
Copy link

hausdora commented Aug 15, 2024

Browser

No response

Package version

3.0.687

React version

18

Description

When generating a theme for build-time theming I get errors for some (or every?) design tokens. There are too many for me to view in my console but they all look like this:

Deprecation Warning: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

   ┌──> node_modules/@cloudscape-design/components-themeable/lib/internal/scss/tutorial-panel/components/tutorial-list/motion.scss
13 │         animation: awsui-motion-fade-in tokens.$motion-duration-show-paced tokens.$motion-easing-show-paced;
   │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
   ╵
   ┌──> node_modules/@cloudscape-design/components-themeable/lib/internal/scss/internal/styles/motion/animations.scss
9  │ ┌   @keyframes awsui-motion-fade-in {
10 │ │     from {
11 │ │       opacity: 0.2;
12 │ │     }
13 │ │ 
14 │ │     to {
15 │ │       opacity: 1;
16 │ │     }
17 │ │   }
   │ └─── nested rule

My theme.ts:

const path = require('path');
const {
  buildThemedComponents,
} = require('@cloudscape-design/components-themeable');

const theme = {
  tokens: {
    // Background colors
    colorBackgroundLayoutMain: {
      light: '#ffffff',
      dark: '#1b1b1b',
    },
  },
};

// module.exports = theme;

buildThemedComponents({
  theme,
  outputDir: path.join(__dirname, './styles/themed'),
});

Versions:
"@cloudscape-design/component-toolkit": "^1.0.0-beta.58",
"@cloudscape-design/components": "^3.0.687",
"@cloudscape-design/components-themeable": "^3.0.729",
"@cloudscape-design/design-tokens": "^3.0.43",
"@cloudscape-design/global-styles": "^1.0.31",

Source code

Reproduction

No response

Code of Conduct

@hausdora hausdora added the bug Something isn't working label Aug 15, 2024
@just-boris
Copy link
Member

Hello!

The "more info" link in the warning contains the info: https://sass-lang.com/d/mixed-decls

This is not an error it is a deprecation warning. We certainly should fix it on our end, but it should not block you because it is a warning only, the output is still fine

@just-boris
Copy link
Member

Released in 3.0.759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants