tachyons-background-size
Version:
Background size CSS module for Tachyons
38 lines (28 loc) • 861 B
CSS
@custom-media --breakpoint-not-small screen and (min-width: 30em);
@custom-media --breakpoint-medium screen and (min-width: 30em) and (max-width: 60em);
@custom-media --breakpoint-large screen and (min-width: 60em);
/*
BACKGROUND SIZE
Media Query Extensions:
-ns = not-small
-m = medium
-l = large
*/
/*
Often used in combination with background image set as an inline style
on an html element.
*/
.cover { background-size: cover; }
.contain { background-size: contain; }
@media (--breakpoint-not-small) {
.cover-ns { background-size: cover; }
.contain-ns { background-size: contain; }
}
@media (--breakpoint-medium) {
.cover-m { background-size: cover; }
.contain-m { background-size: contain; }
}
@media (--breakpoint-large) {
.cover-l { background-size: cover; }
.contain-l { background-size: contain; }
}