bulma/sass/utilities/mixins.sass

213 lines
4.0 KiB
Sass
Raw Normal View History

2016-01-24 00:03:43 +00:00
=arrow($color)
border: 1px solid $color
border-right: 0
border-top: 0
content: " "
display: block
2016-10-29 20:51:13 +00:00
height: 0.5em
2016-01-24 00:03:43 +00:00
pointer-events: none
position: absolute
transform: rotate(-45deg)
2016-10-29 20:51:13 +00:00
width: 0.5em
2016-01-24 00:03:43 +00:00
2016-09-22 22:14:18 +00:00
=block
&:not(:last-child)
2016-10-29 17:53:30 +00:00
margin-bottom: 1.5rem
2016-09-22 22:14:18 +00:00
2016-01-24 00:03:43 +00:00
=clearfix
&:after
clear: both
content: " "
display: table
=center($size)
left: 50%
margin-left: -($size / 2)
margin-top: -($size / 2)
position: absolute
top: 50%
2016-09-22 22:14:18 +00:00
=delete
+unselectable
-moz-appearance: none
-webkit-appearance: none
2016-09-23 21:08:03 +00:00
background-color: rgba($black, 0.1)
2016-09-22 22:14:18 +00:00
border: none
border-radius: 290486px
cursor: pointer
display: inline-block
height: 24px
2016-09-23 21:08:03 +00:00
outline: none
2016-09-22 22:14:18 +00:00
position: relative
vertical-align: top
width: 24px
&:before,
&:after
background-color: $white
content: ""
display: block
height: 2px
left: 50%
margin-left: -25%
margin-top: -1px
position: absolute
top: 50%
width: 50%
&:before
transform: rotate(45deg)
&:after
transform: rotate(-45deg)
&:hover
2016-09-23 21:08:03 +00:00
background-color: rgba($black, 0.2)
2016-09-22 22:14:18 +00:00
// Sizes
&.is-small
height: 16px
width: 16px
&.is-medium
height: 32px
width: 32px
&.is-large
height: 40px
width: 40px
2016-01-24 00:03:43 +00:00
=fa($size, $dimensions)
display: inline-block
font-size: $size
height: $dimensions
line-height: $dimensions
text-align: center
vertical-align: top
width: $dimensions
2016-09-24 15:04:53 +00:00
=hamburger($dimensions)
2016-09-22 22:14:18 +00:00
cursor: pointer
display: block
2016-09-24 15:04:53 +00:00
height: $dimensions
2016-09-22 22:14:18 +00:00
position: relative
2016-09-24 15:04:53 +00:00
width: $dimensions
2016-09-22 22:14:18 +00:00
span
background-color: $text
display: block
height: 1px
left: 50%
margin-left: -7px
position: absolute
top: 50%
transition: none $speed $easing
transition-property: background, left, opacity, transform
width: 15px
&:nth-child(1)
margin-top: -6px
&:nth-child(2)
margin-top: -1px
&:nth-child(3)
margin-top: 4px
&:hover
background-color: $background
// Modifers
&.is-active
span
background-color: $link
&:nth-child(1)
margin-left: -5px
transform: rotate(45deg)
transform-origin: left top
&:nth-child(2)
opacity: 0
&:nth-child(3)
margin-left: -5px
transform: rotate(-45deg)
transform-origin: left bottom
2016-10-16 18:15:56 +00:00
@keyframes spinAround
from
transform: rotate(0deg)
to
transform: rotate(359deg)
2016-09-22 22:14:18 +00:00
=loader
2016-10-16 18:15:56 +00:00
animation: spinAround 500ms infinite linear
2016-09-22 22:14:18 +00:00
border: 2px solid $border
border-radius: 290486px
border-right-color: transparent
border-top-color: transparent
content: ""
display: block
2016-10-29 20:51:13 +00:00
height: 1rem
2016-09-22 22:14:18 +00:00
position: relative
2016-10-29 20:51:13 +00:00
width: 1rem
2016-09-22 22:14:18 +00:00
2016-01-24 00:03:43 +00:00
=overlay($offset: 0)
bottom: $offset
left: $offset
position: absolute
right: $offset
top: $offset
=placeholder
$placeholders: ':-moz' ':-webkit-input' '-moz' '-ms-input'
@each $placeholder in $placeholders
&:#{$placeholder}-placeholder
@content
=replace($background, $width, $height)
2016-06-29 22:59:48 +00:00
background-color: $background
background-position: center center
background-repeat: no-repeat
2016-01-24 00:03:43 +00:00
background-size: $width $height
display: block
height: $height
outline: none
overflow: hidden
text-indent: -290486px
width: $width
2016-09-22 22:14:18 +00:00
=unselectable
-webkit-touch-callout: none
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
user-select: none
2016-09-22 19:30:09 +00:00
// Responsiveness
$tablet: 769px !default
$desktop: 980px !default
$widescreen: 1180px !default
2016-01-24 00:03:43 +00:00
=from($device)
@media screen and (min-width: $device)
@content
=until($device)
@media screen and (max-width: $device - 1px)
@content
=mobile
@media screen and (max-width: $tablet - 1px)
@content
=tablet
@media screen and (min-width: $tablet)
@content
=tablet-only
@media screen and (min-width: $tablet) and (max-width: $desktop - 1px)
@content
2016-01-24 00:03:43 +00:00
=touch
@media screen and (max-width: $desktop - 1px)
@content
=desktop
@media screen and (min-width: $desktop)
@content
=desktop-only
@media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
@content
=widescreen
@media screen and (min-width: $widescreen)
@content