Skip to content

Instantly share code, notes, and snippets.

@Danushka181
Created September 19, 2023 15:51
Show Gist options
  • Select an option

  • Save Danushka181/0e33d44537624f665e55a3fb72c96763 to your computer and use it in GitHub Desktop.

Select an option

Save Danushka181/0e33d44537624f665e55a3fb72c96763 to your computer and use it in GitHub Desktop.
media mixings for scss
$phone: 320px;
$phone-landscape: 576px;
$tab_portrate: 768px;
$tab_landscape: 992px;
$desktop_medium: 1024px;
$desktop_extra: 1200px;
$desktop_extra-medium: 1400px;
$desktop_large: 1600px;
$desktop_extra_large: 1900px;
@mixin phone {
@media only screen and (min-width: $phone) {
@content;
}
}
@mixin phone-l {
@media only screen and (min-width: $phone-landscape) {
@content;
}
}
@mixin tab-p {
@media only screen and (min-width: $tab_portrate) {
@content;
}
}
@mixin tab-l {
@media only screen and (min-width: $tab_landscape) {
@content;
}
}
@mixin desktop-m {
@media only screen and (min-width: $desktop_medium) {
@content;
}
}
@mixin desktop-s {
@media only screen and (min-width: $desktop_extra-medium) {
@content;
}
}
@mixin desktop-e {
@media only screen and (min-width: $desktop_extra) {
@content;
}
}
@mixin desktop-l {
@media only screen and (min-width: $desktop_large) {
@content;
}
}
@mixin desktop-xl {
@media only screen and (min-width: $desktop_extra_large) {
@content;
}
}
@mixin transition($prop) {
-webkit-transition: $prop;
-moz-transition: $prop;
-o-transition: $prop;
transition: $prop;
}
@mixin transform($prop) {
-webkit-transform: $prop;
-moz-transform: $prop;
-o-transform: $prop;
transform: $prop;
}
@mixin after-before {
position: absolute;
content: "";
}
@mixin icon-list {
padding: 0 0 0 30px;
position: relative;
font-weight: 400;
font-size: 14px;
line-height: 21px;
letter-spacing: 0.15px;
color: #4cbb17;
list-style: none;
&::before {
@include after-before;
left: 0;
top: 0;
width: 22px;
height: 22px;
background: url($list-icon) no-repeat;
}
}
@mixin banner-slider-gradient {
@include after-before;
pointer-events: none;
width: 100%;
height: 100%;
inset: 0;
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0) 29.17%,
rgba(0, 0, 0, 0.74) 99.05%
);
box-shadow: 0 0 20px 2px rgba(183, 183, 183, 0.42);
border-radius: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment