•  


Allow to set a style-src CSP without unsafe-inline by ArthurWD · Pull Request #8338 · chakra-ui/chakra-ui · GitHub
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

Allow to set a style-src CSP without unsafe-inline #8338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ArthurWD
Copy link

Closes #8043 , #7600

?? Description

This PR allows to set a style-src CSP without unsafe-inline

?? Current behavior (updates)

Chakra currently uses both the style attribute on HTML elements and an injected style element. Both require unsafe-inline style-src.

?? New behavior

  • Uses direct style props like flex={1} instead of style={{ flex: 1 }} .
  • Uses __css instead of style where an style object is used.
  • Adds the option to pass a nonce to the ColorModeProvider where the style element is injected.

?? Is this a breaking change:

No

?? Additional Information

I was unable to test the behaviour locally, because I had issues linking to the local directory from my package.json. I haven't tested all changes myself, so please take a good look.

Also, there are some places where a style attribute is set on motion.div . I was not sure how to handle this, so I haven't fixed those issues.

Copy link

changeset-bot bot commented Mar 4, 2024

?? No Changeset found

Latest commit: aab0c48

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one .

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

Copy link

vercel bot commented Mar 4, 2024

The latest updates on your projects . Learn more about Vercel for Git ↗?

Name Status Preview Updated (UTC)
chakra-ui-storybook ? Ready ( Inspect ) Visit Preview Mar 4, 2024 2:35pm
chakra-ui-website ? Failed ( Inspect ) Mar 4, 2024 2:35pm

@benmcginnis
Copy link

it would be really nice to get this merged, even though I know y'all are working on the v3 migration in earnest. this would be really helpful for those of us who're going to be on v2 for a while

@ra-lfaro
Copy link

+1 Would also like this support in

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.

CSP error thrown by color-mode.util
3 participants
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본