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

fix(column): remove percentage character only if present #15312

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

janhassel
Copy link
Member

@janhassel janhassel commented Dec 4, 2023

Closes #15311

See issue for details. Currently, if the user passes md="8" it will generate the following css classname: cds--md:col-span-. Passing in lg="16" will result to cds--lg:col-span-1.

Changelog

Changed

  • Instead of always removing the last character, only remove a percentage sign if one exists

Testing / Reviewing

  • See linked issue's reproduction

@janhassel janhassel requested a review from a team as a code owner December 4, 2023 09:34
Copy link

netlify bot commented Dec 4, 2023

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 95aa577
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/65737296a3b6fe00088c0df0
😎 Deploy Preview https://deploy-preview-15312--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

I'm personally still on the fence about these percentage classes. 😅 We only kind of "soft-support" them - I think there's only classes for 25%, 50%, 75%, 100%? It was a new idea added in the initial CSSGrid implementation that IIRC we didn't have previously with FlexGrid. Anyway, I'm glad someone is using them, and appreciate you submitting this fix!

@janhassel
Copy link
Member Author

@tay1orjones I am actually not using the percentage classes in any designs and did not know they exist. 😅 I came across this when I was prototyping without TypeScript for a change and did not remember that the type should be number instead of string.

@github-actions github-actions bot enabled auto-merge December 8, 2023 19:46
@github-actions github-actions bot added this pull request to the merge queue Dec 8, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 8, 2023
@tay1orjones tay1orjones merged commit 7ebcca1 into carbon-design-system:main Dec 11, 2023
21 checks passed
@janhassel janhassel deleted the 15311 branch December 12, 2023 07:50
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Column span is not working as expected when passed as string instead of number
3 participants