fix(Button): wrap responsive height styles in css helper#2021
Conversation
|
@Akash5908 is attempting to deploy a commit to the Strapi Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



What does it do?
It fixes invalid CSS generation in the
Buttoncomponent when rendering responsive button heights. It imports thecsshelper fromstyled-componentsand wraps the dynamic height styles incsstemplates rather than returning a raw concatenated string.Why is it needed?
After updating Strapi, custom plugins using
<Button variant="secondary" fullWidth ...>encountered invalid CSS-styles. Instyled-componentsv6, returning a raw string containing media query brace blocks (@media (...) { ... }) from functional interpolations can break the CSS stylesheet parser (stylis v4). Using thecsstemplate helper compiles the styles correctly as nested AST rules, avoiding formatting and syntax breakages in the generated stylesheet.How to test it?
yarn build(which builds successfully).<Button variant="secondary" fullWidth ...>and inspect the button element styles. The height styles should be successfully applied across breakpoints without syntax errors in the document stylesheets.Related issue(s)/PR(s)
Resolves the invalid CSS styles issue with the
Buttoncomponent following responsive mobile size adjustments. #2006