Skip to content

Treat columns property as a unitless number - #10115

Merged
gaearon merged 1 commit into
react:masterfrom
aweary:fix-columns-css-property
Jul 11, 2017
Merged

Treat columns property as a unitless number#10115
gaearon merged 1 commit into
react:masterfrom
aweary:fix-columns-css-property

Conversation

@aweary

Copy link
Copy Markdown
Contributor

Resolves#10043

@awearyaweary mentioned this pull request Jul 6, 2017
12 tasks
@gaearon

Copy link
Copy Markdown
Collaborator

Can't it also specify width? https://css-tricks.com/almanac/properties/c/columns/
Have you verified this is the right fix?

@aweary

Copy link
Copy Markdown
ContributorAuthor

@gaearon yes, it's a shorthand property like flex. If you provide only a number it's assumed you are setting column-count and column-width is defaulted to auto

<divstyle={{columns: 2}}/>// Renders `columns: auto 2`

If you provide an explicit pixel value it assumes you're setting the column-width and column-count defaults to auto.

<divstyle={{columns: "320px"}}/>// Renders `columns: 320px auto`

Since it's already assumed that a single numerical value represents column-count we should be consistent with that by treating it as a unitless number.

@nhunzaker

Copy link
Copy Markdown
Contributor

Flex box is a good reference point. I'd be in favor of matching it.

@gaearon

Copy link
Copy Markdown
Collaborator

👍 Leaving this up to you folks

@gaearon
gaearon merged commit ab4ddf6 into react:masterJul 11, 2017
@nhunzakernhunzaker mentioned this pull request Aug 10, 2017
11 tasks
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@aweary@gaearon@nhunzaker@facebook-github-bot