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

feat(core): template variants #20

Open
tremppu opened this issue Nov 26, 2024 · 1 comment
Open

feat(core): template variants #20

tremppu opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tremppu
Copy link
Contributor

tremppu commented Nov 26, 2024

as currently it's possible to create templates as in textStyle: 'headline.large' with named property and template name with dot notation, would be great to add variants that could then override styles if needed. This for example would be used for changing fontWeight.

Example is related to: #12

Initial idea for syntax: textStyle: 'headline.large/fw300'

This could be done with base / css + variants setup as in

{
  templates: {
    textStyle: {
      headline: {
        large: {
          css: {
            fontSize: '60px',
            fontWeight: 600,
          },
          variants: {
            fw: {
              300: {
                fontWeight: 300,
              }
            }
          }
        }
      }
    }
  }
}
@tremppu tremppu added the enhancement New feature or request label Nov 26, 2024
@tremppu tremppu self-assigned this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
@tremppu and others