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

Flex basis alias support #13

Merged
merged 9 commits into from
Feb 17, 2023

Conversation

lievenjanssen
Copy link
Contributor

Some additional improvements/questions:

  • Currently we both support data-fx-flex-grow and data-fx-flex="grow" for attributes. Should we deprecate data-fx-flex-grow?
  • Can we replace
    *:has(>.fx-flex,>.fx-flex-grow):not([class*="fx-layout-"]) {
    by *:has(>[class^="fx-flex"]):not([class*="fx-layout-"]) and remove these lines:
    *:has(>.fx-flex--#{$name},>.fx-flex-grow--#{$name}):not([class*="fx-layout-"]) {
    @include flex-row-properties;
    }
  • Is there a reason why we don't automatically add flex to the parent container of flex-attributes-for-media-sizes?
    // these do not automatically add flex to their parent container
    @mixin flex-attributes-for-media-sizes {

What do you think?

@philmtd
Copy link
Owner

philmtd commented Feb 15, 2023

Hey, thank you so much for this PR!

Currently we both support data-fx-flex-grow and data-fx-flex="grow" for attributes. Should we deprecate data-fx-flex-grow?

Yes, I think we should deprecate it.

Can we replace [...]

I think we can. I'm not sure why I did it the way it is implemented now but currently I don't see why using the shortcut you suggested should not work. Probably I did not take enough time to figure out the best solution 🙃

Is there a reason why we don't automatically add flex to the parent container of flex-attributes-for-media-sizes?

I think I assumed that, when you use flex with media sizes you will definitely also use flex without media sizes, which would already add the properties to the parent. But I guess that would not work in projects where there are no default styles applied and only media sizes used. What do you think about this? Should we add it? I'm not sure how important that would be but I'm open to adding it if you think it may be useful.

src/lib/mixins.scss Outdated Show resolved Hide resolved
src/lib/flex-attributes.scss Outdated Show resolved Hide resolved
@lievenjanssen
Copy link
Contributor Author

lievenjanssen commented Feb 16, 2023

There's actually an issue with the auto apply row layout shortcut. It needs to be more specific since you only want to apply the flex-row-properties for the correct media query. I'll probably leave the current implementation for now.

I think we should at least be consistent if we add it automatically to the flex class media query selectors to also add it to the flex attribute media query selectors. I think there are use cases where you would only apply flex on a certain screen size while not having a general flex. Ok to fix it like that?

@philmtd
Copy link
Owner

philmtd commented Feb 16, 2023

Ok to fix it like that?

Absolutely, that makes sense!

@philmtd
Copy link
Owner

philmtd commented Feb 16, 2023

This looks good to me now. Is there anything open you want to change here? If not I'd merge that.

@lievenjanssen
Copy link
Contributor Author

This looks good to me now. Is there anything open you want to change here? If not I'd merge that.

This can be merged. I didn't update the documentation yet though. Is that something you could do?

@philmtd
Copy link
Owner

philmtd commented Feb 17, 2023

Sure, I can take care of the documentation. I was thinking of moving the docs from the Wiki over to the repo anyway so the docs are versioned together with the code.

@philmtd philmtd merged commit 0d3e178 into philmtd:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants