Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_mixins.scss « _sass - github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 01a8d16dbf17f7d1ab907d84d0275fbea4fa87b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* ==========================================================================
   Mixins
   ========================================================================== */

/* 
   Utility mixins
   ========================================================================== */

/* clearfix */
@mixin clearfix {
  *zoom: 1;

  &:before,
  &:after {
    display: table;
    content: "";
    // Fixes Opera/contenteditable bug:
    // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
    line-height: 0;
  }

  &:after {
    clear: both;
  }
}

/* Webkit-style focus */
@mixin tab-focus() {
  // Default
  outline: thin dotted #333;
  // Webkit
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

/* Center-align a block level element */

@mixin center-block() {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* 
   Typography mixins
   ========================================================================== */

/* Full-fat vertical rhythm */
@mixin font-size($size) {
  font-size: 0px + $size;
  font-size: 0rem + $size / $doc-font-size;
  line-height: 0 + round($doc-line-height / $size*10000) / 10000;
  margin-bottom: 0px + $doc-line-height;
  margin-bottom: 0rem + ($doc-line-height / $doc-font-size);
}

/* Just the REMs */
@mixin font-rem($size) {
  font-size: 0px + $size;
  font-size: 0rem + $size / $doc-font-size;
}

/* Just font-size and line-height */
@mixin font($size) {
  font-size: 0px + $size;
  font-size: 0rem + $size / $doc-font-size;
  line-height: 0 + round($doc-line-height / $size*10000) / 10000;
}

/* Ellipsis */
@mixin text-overflow() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; 
}

/* 
   Visibility
   ========================================================================== */

/* For image replacement */
@mixin hide-text() {
  text-indent : 100%;
  white-space : nowrap;
  overflow : hidden; 
}

/* Hide from visual and speaking browsers */
@mixin hidden() {
  display : none !important; 
  visibility : hidden; 
}
.hidden {
  display: none;
  visibility: hidden;
}

/* Hide but maintain layout */
@mixin invisible() { 
  visibility : hidden; 
}

/* Hidden but available to speaking browsers */
@mixin visuallyhidden() { 
  overflow : hidden; 
  position : absolute;
  clip : rect(0 0 0 0); 
  height : 1px; 
  width : 1px;
  margin : -1px; 
  padding : 0; 
  border : 0; 
}

/* Make visuallyhidden focusable with a keyboard */
.visuallyhidden.focusable:active, 
.visuallyhidden.focusable:focus { 
  position : static;
  clip : auto; 
  height : auto; 
  width : auto;
  margin : 0; 
  overflow: visible; 
}