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

Fix .hide utilities #746

Merged
merged 2 commits into from
Apr 5, 2019
Merged

Fix .hide utilities #746

merged 2 commits into from
Apr 5, 2019

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Apr 5, 2019

This fixes the hide-xx utilities when used to toggle two elements at different breakpoints.

Before After
hide-b hide-a

Problem

The .hide-xx utilities overlap by 1 px at each break point. Currently the values are like this:

.hide-sm: 0 - 544px
.hide-md:     544px - 768px
.hide-lg:             768px - 1012px
.hide-xl:                     1012px - infinite

So if two elements get toggled like with:

<div class="hide-md"></div>
<div class="hide-lg"></div>

At exactly 768px both elements are hidden.

Fix

By removing 1px from all the max-widths, e.g. max-width: $width-sm - 1px, they don't overlap anymore and continue seamless:

.hide-sm: 0 - 543px
.hide-md:          544px - 767px
.hide-lg:                       768px - 1011px
.hide-xl:                                     1012px - infinite

@simurai simurai mentioned this pull request Apr 5, 2019
8 tasks
@simurai simurai changed the base branch from master to release-12.2.2 April 5, 2019 13:00
@simurai simurai changed the base branch from release-12.2.2 to master April 5, 2019 13:08
@simurai simurai changed the base branch from master to release-12.2.2 April 5, 2019 13:08
@shawnbot
Copy link
Contributor

shawnbot commented Apr 5, 2019

Thanks for this, @simurai! I'm going to update the docs in this PR and merge it!

Copy link
Contributor

@shawnbot shawnbot left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for this! 🛠

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.

2 participants