1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-12 08:05:18 +01:00
blog/_src/assets/styl/mixins.styl

241 lines
4.2 KiB
Stylus
Raw Normal View History

2014-07-12 02:00:18 +02:00
//
// kremalicious3
// --------------
// Mixins
//
// Micro Clearfix
/////////////////////////////////////
clearfix()
2014-07-12 21:22:47 +02:00
&:before,
2014-07-12 02:00:18 +02:00
&:after
2014-07-12 21:22:47 +02:00
content: " "
2014-07-12 02:00:18 +02:00
display: table
2014-07-12 21:22:47 +02:00
&:after
2014-07-12 02:00:18 +02:00
clear: both
.clearfix
clearfix()
// Floats
/////////////////////////////////////
alignright()
float: right
alignleft()
float: left
.alignright
alignright()
.alignleft
alignleft()
// Centering Blocks
/////////////////////////////////////
aligncenter()
display: block
margin-left: auto
margin-right: auto
.aligncenter
aligncenter()
// Centering Text
/////////////////////////////////////
textcenter()
2014-07-12 21:22:47 +02:00
text-align: center
2014-07-12 02:00:18 +02:00
.textcenter
2014-07-12 21:22:47 +02:00
textcenter()
2014-07-12 02:00:18 +02:00
// Toggling content
/////////////////////////////////////
// Hide from both screenreaders and browsers: h5bp.com/u
2014-07-12 21:22:47 +02:00
hide()
2014-07-12 02:00:18 +02:00
display: none !important
visibility: hidden
2014-07-12 21:22:47 +02:00
show()
2014-07-12 02:00:18 +02:00
display: block
visibility: visible
2014-07-12 21:22:47 +02:00
.hide
hide()
.show
show()
2014-07-12 02:00:18 +02:00
// Hide only visually, but have it available for screenreaders: h5bp.com/v
2014-07-12 21:22:47 +02:00
visuallyhidden()
2014-07-12 02:00:18 +02:00
border: 0
clip: rect(0 0 0 0)
height: 1px
margin: -1px
overflow: hidden
padding: 0
position: absolute
width: 1px
// Extends the .visuallyhidden class to allow the
// element to be focusable when navigated to via the keyboard: h5bp.com/p
&.focusable:active,
&.focusable:focus
clip: auto
height: auto
margin: 0
overflow: visible
position: static
width: auto
2014-07-12 21:22:47 +02:00
.visuallyhidden
visuallyhidden()
2014-07-12 02:00:18 +02:00
// Hide visually and from screenreaders, but maintain layout
.invisible
visibility: hidden
// CSS image replacement
/////////////////////////////////////
.ir,
.hide-text
2014-07-12 21:22:47 +02:00
font: 0/0 a
color: transparent
text-shadow: none
background-color: transparent
border: 0
2014-07-12 02:00:18 +02:00
// Dimmed Text
/////////////////////////////////////
dimmed()
2014-07-12 21:22:47 +02:00
color: $text-color-dimmed
p
2014-07-12 02:00:18 +02:00
color: $text-color-dimmed
2014-07-12 21:22:47 +02:00
li
2014-07-12 02:00:18 +02:00
color: $text-color-dimmed
.dimmed
dimmed()
// Text overflow
/////////////////////////////////////
2014-07-12 21:22:47 +02:00
ellipsis()
2014-07-12 02:00:18 +02:00
text-overflow: ellipsis
2014-07-12 21:22:47 +02:00
overflow: hidden
2014-07-12 02:00:18 +02:00
white-space: nowrap
2014-07-12 21:22:47 +02:00
.ellipsis
ellipsis()
// Default transition
/////////////////////////////////////
transition()
transition: all ease-in-out .15s
.transition
transition()
2014-07-12 02:00:18 +02:00
// Dashed Dividers
/////////////////////////////////////
.divider-top,
.divider-bottom
position: relative
&:before
2014-07-12 21:22:47 +02:00
content: ""
position: absolute
left: 0
2014-07-12 02:00:18 +02:00
height: 1px
.divider-top
2014-07-12 21:22:47 +02:00
border-top: 1px dashed #afc3cb
padding-top: 1em
2014-07-12 02:00:18 +02:00
2014-07-12 21:22:47 +02:00
&:after
content: ""
position: absolute
left: 0
2014-07-12 02:00:18 +02:00
height: 1px
2014-07-12 21:22:47 +02:00
top: 0
width: 100%
border-top: 1px dashed #fff
2014-07-12 02:00:18 +02:00
.divider-bottom
2014-07-12 21:22:47 +02:00
border-bottom: 1px dashed #afc3cb
padding-bottom: 1em
2014-07-12 02:00:18 +02:00
2014-07-12 21:22:47 +02:00
&:before
bottom: -2px
width: 100%
border-bottom: 1px dashed #fff
2014-07-12 02:00:18 +02:00
// Heading band
/////////////////////////////////////
.heading-band
2014-07-12 21:22:47 +02:00
display: inline-block
clear: both
background: rgba(255,255,255,.55)
padding: ($line-height-computed/2) $line-height-computed ($line-height-computed/2) 100%
margin-left: -100%
2014-07-12 02:00:18 +02:00
// Lead paragraph
/////////////////////////////////////
.lead
2014-07-12 21:22:47 +02:00
font-size: $font-size-large
line-height: ($line-height-computed*1.15)
2014-07-12 02:00:18 +02:00
// Button sizing
/////////////////////////////////////
button-size(padding-vertical, padding-horizontal, font-size, line-height, border-radius)
padding: padding-vertical padding-horizontal
font-size: font-size
line-height: line-height
border-radius: border-radius
// Form control sizing
/////////////////////////////////////
input-size(input-height, padding-vertical, padding-horizontal, font-size, line-height, border-radius)
height: input-height
padding: padding-vertical padding-horizontal
font-size: font-size
line-height: line-height
border-radius: border-radius
input[type="search"]&
background-size: font-size
background-position: padding-vertical center
padding-left: (padding-vertical*4)
select&
height: input-height
line-height: input-height
textarea&,
select[multiple]&
2014-07-12 21:22:47 +02:00
height: auto