-
-
Save pbatey/2b8b038c30c0fccf3461ecfcd41c8b36 to your computer and use it in GitHub Desktop.
Responsive helpers (mobile-only etc.) for semantic-ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Semantic UI has these classes, however they're only applicable to*/ | |
/* grids, containers, rows and columns.*/ | |
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/ | |
/* this snippet is using the same class names and same approach*/ | |
/* plus a bit more but to all elements.*/ | |
/* see https://github.com/Semantic-Org/Semantic-UI/issues/1114*/ | |
/* Portrait */ | |
@media only screen and (max-width: 414px) { | |
[class*="portrait hidden"], | |
[class*="mobile only"]:not(.portrait), | |
[class*="tablet only"]:not(.portrait), | |
[class*="computer only"]:not(.portrait), | |
[class*="large screen only"]:not(.portrait), | |
[class*="widescreen only"]:not(.portrait) { | |
display: none !important; | |
} | |
} | |
@media only screen and (min-width: 415px) and (max-width: 767px) { | |
[class*="portrait only"]:not(.mobile), | |
[class*="mobile hidden"], | |
[class*="tablet only"]:not(.mobile), | |
[class*="computer only"]:not(.mobile), | |
[class*="large screen only"]:not(.mobile), | |
[class*="widescreen only"]:not(.mobile), | |
[class*="or lower hidden"] { | |
display: none !important; | |
} | |
} | |
/* Tablet / iPad Portrait */ | |
@media only screen and (min-width: 768px) and (max-width: 991px) { | |
[class*="portrait only"]:not(.tablet), | |
[class*="mobile only"]:not(.tablet), | |
[class*="tablet hidden"], | |
[class*="computer only"]:not(.tablet), | |
[class*="large screen only"]:not(.tablet), | |
[class*="widescreen only"]:not(.tablet), | |
[class*="or lower hidden"]:not(.mobile) { | |
display: none !important; | |
} | |
} | |
/* Computer / Desktop / iPad Landscape */ | |
@media only screen and (min-width: 992px) and (max-width: 1199px) { | |
[class*="portrait only"]:not(.computer), | |
[class*="mobile only"]:not(.computer), | |
[class*="tablet only"]:not(.computer), | |
[class*="computer hidden"], | |
[class*="large screen only"]:not(.computer), | |
[class*="widescreen only"]:not(.computer), | |
[class*="or lower hidden"]:not(.tablet):not(.mobile) { | |
display: none !important; | |
} | |
} | |
/* Large Monitor */ | |
@media only screen and (min-width: 1200px) and (max-width: 1919px) { | |
[class*="portrait only"]:not([class*="large screen"]), | |
[class*="mobile only"]:not([class*="large screen"]), | |
[class*="tablet only"]:not([class*="large screen"]), | |
[class*="computer only"]:not([class*="large screen"]), | |
[class*="large screen hidden"], | |
[class*="widescreen only"]:not([class*="large screen"]), | |
[class*="or lower hidden"]:not(.computer):not(.tablet):not(.mobile) { | |
display: none !important; | |
} | |
} | |
/* Widescreen Monitor */ | |
@media only screen and (min-width: 1920px) { | |
[class*="portrait only"]:not([class*="widescreen"]), | |
[class*="mobile only"]:not([class*="widescreen"]), | |
[class*="tablet only"]:not([class*="widescreen"]), | |
[class*="computer only"]:not([class*="widescreen"]), | |
[class*="large screen only"]:not([class*="widescreen"]), | |
[class*="widescreen hidden"], | |
[class*="widescreen or lower hidden"] { | |
display: none !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment