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

Treat columns property as a unitless number #10115

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

aweary
Copy link
Contributor

@aweary aweary commented Jul 6, 2017

Resolves #10043

@aweary aweary mentioned this pull request Jul 6, 2017
12 tasks
@gaearon
Copy link
Collaborator

gaearon commented Jul 6, 2017

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
Contributor Author

aweary commented Jul 6, 2017

@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

<div style={{ 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.

<div style={{ 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
Contributor

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

@gaearon
Copy link
Collaborator

gaearon commented Jul 6, 2017

👍 Leaving this up to you folks

@gaearon gaearon merged commit ab4ddf6 into facebook:master Jul 11, 2017
@nhunzaker nhunzaker mentioned this pull request Aug 10, 2017
11 tasks
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.

4 participants