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: strictTokens escape hatch for arbitrary values #1756

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

astahmer
Copy link
Collaborator

@astahmer astahmer commented Dec 3, 2023

Closes #1001

πŸ“ Description

Add an escape-hatch for arbitrary values when using config.strictTokens, by prefixing the value with [ and suffixing
with ], e.g. writing [123px] as a value will bypass the token validation.

import { css } from '../styled-system/css'

css({
  // @ts-expect-error TS will throw when using from strictTokens: true
  color: '#fff',
  // @ts-expect-error TS will throw when using from strictTokens: true
  width: '100px',

  // βœ… but this is now allowed:
  bgColor: '[rgb(51 155 240)]',
  fontSize: '[12px]',
})

πŸ’£ Is this a breaking change (Yes/No):

no

πŸ“ Additional Information

We've listened and more enhancements will come for the config.strictTokens DX, thank you for providing great feedback !

Copy link

changeset-bot bot commented Dec 3, 2023

πŸ¦‹ Changeset detected

Latest commit: b60a090

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@pandacss/generator Minor
@pandacss/shared Minor
@pandacss/core Minor
@pandacss/node Minor
@pandacss/parser Minor
@pandacss/dev Minor
@pandacss/config Minor
@pandacss/studio Minor
@pandacss/token-dictionary Minor
@pandacss/postcss Minor
@pandacss/astro Minor
@pandacss/error Minor
@pandacss/extractor Minor
@pandacss/fixture Minor
@pandacss/is-valid-prop Minor
@pandacss/logger Minor
@pandacss/preset-atlaskit Minor
@pandacss/preset-base Minor
@pandacss/preset-panda Minor
@pandacss/types Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 3, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
panda-docs βœ… Ready (Inspect) Visit Preview Dec 4, 2023 8:49am
panda-playground βœ… Ready (Inspect) Visit Preview Dec 4, 2023 8:49am
panda-studio βœ… Ready (Inspect) Visit Preview Dec 4, 2023 8:49am

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.

None yet

2 participants