Navigation Menu

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

Add basic flexbox implementation of grid for IE #2943

Merged
merged 6 commits into from Mar 25, 2020

Conversation

bartaz
Copy link
Contributor

@bartaz bartaz commented Mar 23, 2020

Done

Adds basic fallback implementation of grid for IE11 using flexbox.

For large screens (12 column grid) simplified flexbox based grid should be applied in IE11.
For smaller screens columns just render one under another.

Fixes #2685

QA

You can use ignore whitespace mode on GitHub when reviewing the code to avoid confusing diff where stuff got nested into @supports.

Screenshot 2020-03-24 at 10 22 57

@webteam-app
Copy link

@bartaz bartaz marked this pull request as ready for review March 24, 2020 09:23
@bartaz bartaz changed the title WIP: Add basic flexbox implementation of grid for IE Add basic flexbox implementation of grid for IE Mar 24, 2020
@lyubomir-popov lyubomir-popov self-assigned this Mar 24, 2020
Copy link
Contributor

@lyubomir-popov lyubomir-popov left a comment

Choose a reason for hiding this comment

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

LGTM, some optional comments.

scss/_base_grid-definitions.scss Outdated Show resolved Hide resolved
// flexbox approximation of grid column styles for IE
// this needs to be a @mixin rather than %placeholder because it's ised inside @media queries
@mixin vf-grid-flex-column {
flex-basis: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not shorthand flex: 1 1 0;?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like to guess what number does what ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

fair :)

@lyubomir-popov
Copy link
Contributor

lyubomir-popov commented Mar 24, 2020

@bartaz just realised that columns do not respect the column classes, just get equal widths; but if you give them flex-grow consistent with the number of columns, it does:

Screenshot 2020-03-24 at 14 45 02

)

@bartaz
Copy link
Contributor Author

bartaz commented Mar 24, 2020

@lyubomir-popov ah, good catch. I used to have % based widths that kinda worked, but removed them. Didn't notice the column width change. But good point about using grow for that, it will be simple enough workaround.

@lyubomir-popov
Copy link
Contributor

lyubomir-popov commented Mar 24, 2020

@bartaz it is not 100% accurate, but close enough. You can see the blue vertical line doesn't coincide with theedge of the 11th 1-col div at the 4-th-to-last row. I guess that's because of the static margin. Either way, completely acceptable in my opinion given this is a fallback.

Copy link
Contributor

@lyubomir-popov lyubomir-popov left a comment

Choose a reason for hiding this comment

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

LGTM.

// flexbox approximation of grid column styles for IE
// this needs to be a @mixin rather than %placeholder because it's ised inside @media queries
@mixin vf-grid-flex-column {
flex-basis: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

fair :)

@bartaz bartaz merged commit 1d40cd5 into canonical:master Mar 25, 2020
@bartaz bartaz deleted the flex-grid branch March 25, 2020 09:25
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.

Grid does not work in IE 11
3 participants