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

Responsive Visibility specificity issue. #33

Open
peterbraden opened this issue Apr 18, 2016 · 0 comments
Open

Responsive Visibility specificity issue. #33

peterbraden opened this issue Apr 18, 2016 · 0 comments
Labels

Comments

@peterbraden
Copy link
Contributor

When using the responsive visibility classes with:

@include sensibleGrid (
    $modern: false,
    $gutter: 24px, 
    $gutterType: margin,
    $base-font-size: 1rem,
    $slug: "l-",
    $pushClasses: true,
    $gridWidths: (
        "one-whole"         : 100%,
        "one-half"          : 50%,
        "one-quarter"       : 25%,
        "three-quarters"    : 75%,
        "one-third"         : 33.333%,
        "two-thirds"        : 66.666%,
        "one-fifth"         : 20%,
        "four-fifths"       : 80%,
        "one-sixth"         : 16.666%,
        "five-sixths"       : 83.333%
    ),
    $gridBreakpoints: "desktop" "tablet" "mobile"
);

@include responsive-visibility("mobile" "desktop" "tablet" , true);

The generated CSS has:

@media only screen and (max-width: 600px)
.is-visible-mobile.is-visible-mobile {
    display: block !important;
    visibility: visible;
}

After:

media only screen and (max-width: 988px)
.is-hidden-tablet, .is-visible-mobile, .is-visible-desktop {
    display: none !important;
    visibility: hidden;
}

Meaning the content is never visible. The visible class needs more specificity.

Workaround:

// Fix a bug where sensible has the wrong specificity for mobile/hidden
@include breakpoint(mobile){
  .is-visible-mobile.is-visible-mobile {
    display: block !important;
    visibility:visible;
  }
}
@meodai meodai added the bug label Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants