-
Notifications
You must be signed in to change notification settings - Fork 3
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
Flex child properties not allowed for inline-flex elements. #207
Comments
Hmm, this is one of those spots where CSS and the component world collide.
As you can see this causes a conflict. A solution would be to have (as you suppose)
Thinking about it, it should be set on the child, not from the parent. I think the rules reflect this correctly, the library prevent parents from setting the If CSS would allow us to only affect the part for the outside of the component (the part before the The workaround is to have 2 child components, one with CC: @JoostKiens |
I created this issue in a bit of a rush, so let me clarify a bit. I'm not sure we're talking about the same situation. When I type the following css, I get a linting error:
.component {
display: inline-flex;
& > .child {
order: -1;
}
} I would have expected this to be allowed, since
and .component {
display: flex;
& > .child {
order: -1;
}
} are allowed. |
Ahh right, yeah. This rule should indeed allow that: https://github.com/kaliberjs/build/blob/master/library/stylelint-plugins/rules/parent-child-policy/index.js Are there any other combinations ( |
The legacy display props, which accept several flex/grid child rules, are: display: grid | inline-grid | flex | inline-flex; According to the spec these are considered legacy, but they are what we use. The modern way uses two keywords; first one for the outside, the second one for the inside. display: inline flex;
display: block grid; And also some newer properties, eg: display: inline flow;
display: run-in grid; But we haven't used that style in production yet (afaik) By the way, this is related: #205. I haven't been able to get the tests working, but perhaps we can solve this at the same time? |
All flex child properties that are allowed to be used inside elements with
display: flex;
should also be allowed for elements withdisplay: inline-flex
.The text was updated successfully, but these errors were encountered: