compass-pug 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/README.md +2 -2
- data/stylesheets/_pug.scss +1 -3
- data/stylesheets/pug/_functions.scss +45 -51
- data/stylesheets/pug/_mixins.scss +85 -95
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDRiZDY2YmUwOGIzNzViZWUxOWE1NjY5YzMyZDE3OWIxOWQ1NDYyYQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5c370fb6cecbb4226f33059fe0e4359ab78f130c
|
4
|
+
data.tar.gz: 753a9e60a1544b9dc5b9bb995f3e72f0d5ea4b07
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NWNjOTkxZWE1NDk1MGU0MDg0MjU0MGUyNmZhOGZhM2JmNmIzYjE2MmJhOTQ2
|
11
|
-
NmNkZGU4NDZiNjczOWE3Zjg1NWNlZjNhNDRkNThkOWYxMDQ3MmE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZDIwODlhNzU4ZDE4OGY2ZDRkMzIzNjY2YjI1YzgwNTlkMzVmMTZmN2ZlYzIy
|
14
|
-
YzY1ODkxN2U2ZDMyMjE5NDZjMTYxNjM0YTlkYjdiMTdkZjE1YjUzYjkzNDRk
|
15
|
-
NWFiMjRlODg5MWY5MzNjN2FiZmUwNzdhYTQ3NzM2MjEzMmZlZmI=
|
6
|
+
metadata.gz: 0fc87d8c67e41826707dc17a79e3e6727dd47375f872e1c9997c76870130777843e7582a2776173c8fa1669bfa3f7f6a53a28d0a431871df40a1a7f7e76c4a7b
|
7
|
+
data.tar.gz: d48cb80b7b4f9be8f7d7dc0726b2f6888cb52721a6b0b37e3cebb8f1e38ec04496c697cc768ebb52f37659685d63d383cb2a49de3464fca6b3af82888497943e
|
data/README.md
CHANGED
@@ -32,8 +32,8 @@ For complete details, including function/mixin parameters, view the `stylesheets
|
|
32
32
|
* `pug-micro-clearfix()`: [Provides Nicolas Gallagher's Micro Clearfix](http://nicolasgallagher.com/micro-clearfix-hack/).
|
33
33
|
* `pug-placeholder-color()`: Generates cross-browser CSS (with selectors) for setting the color of input field placeholder text. Via [CSS Tricks](http://css-tricks.com/snippets/css/style-placeholder-text/).
|
34
34
|
* `pug-tab-size()`: Vendor-prefixed tab sizing. Use with elements such as `pre`.
|
35
|
-
* `pug-sr-only()`: Apply to an element to make it accessible only to screen readers. [Adapted from Bootstrap 3](http://getbootstrap.com/css/#helper-classes-screen-readers).
|
36
|
-
* `pug-sr-only-focusable()`: Applies (optionally, and by default) `pug-sr-only()` and shows the element again when it's focused. [Adapted from Bootstrap 3](http://getbootstrap.com/css/#helper-classes-screen-readers).
|
35
|
+
* `pug-sr-only()`: Apply to an element to make it accessible only to screen readers. Optionally include `$focusable:true` to allow the element to be focusable when navigated to via the keyboard. [Adapted from Bootstrap 3](http://getbootstrap.com/css/#helper-classes-screen-readers).
|
36
|
+
* `pug-sr-only-focusable()`: *DEPRECATED (use `pug-sr-only($focusable:true).` instead)* Applies (optionally, and by default) `pug-sr-only()` and shows the element again when it's focused. [Adapted from Bootstrap 3](http://getbootstrap.com/css/#helper-classes-screen-readers).
|
37
37
|
|
38
38
|
### Sass Functions
|
39
39
|
|
data/stylesheets/_pug.scss
CHANGED
@@ -1,19 +1,16 @@
|
|
1
|
-
|
1
|
+
// Pug - Core Functions
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
* @param number $minimum-difference-proportion
|
15
|
-
* Minimum acceptable proportional diff.
|
16
|
-
*/
|
3
|
+
// Calculate an appropriate line-height value that maintains vertical rhythm.
|
4
|
+
//
|
5
|
+
// Note that $font-size and $vertical-unit must use the same unit of measurement (px, rem, em, etc).
|
6
|
+
//
|
7
|
+
// @param string $font-size
|
8
|
+
// Font-size to use for generating the line-height result. Must have same unit of measurement as $vertical-unit.
|
9
|
+
// @param string $vertical-unit
|
10
|
+
// @param number $division
|
11
|
+
// Represents how $vertical-unit will be divided. Usually this should be 1, 0.5 or 0.25.
|
12
|
+
// @param number $minimum-difference-proportion
|
13
|
+
// Minimum acceptable proportional diff.
|
17
14
|
@function pug-calculate-line-height(
|
18
15
|
$font-size: $pug-vr-base-font-size,
|
19
16
|
$vertical-unit: $pug-vr-vertical-unit,
|
@@ -46,22 +43,21 @@
|
|
46
43
|
}
|
47
44
|
}
|
48
45
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
*/
|
46
|
+
// Round a size up to the nearest factor of a vertical unit (or of a sub-unit of that vertical unit).
|
47
|
+
//
|
48
|
+
// Parameters must use the same unit of measurement (rem, px, etc).
|
49
|
+
//
|
50
|
+
// @param string $original-size
|
51
|
+
// @param string $vertical-unit
|
52
|
+
// @param number $division
|
53
|
+
// If you want to allow factors of a division of $vertical-unit, use a decimal value here (like 0.5).
|
58
54
|
@function pug-round-up-to-nearest-vertical-unit(
|
59
55
|
$original-size,
|
60
56
|
$vertical-unit: $pug-vr-vertical-unit,
|
61
57
|
$division: $pug-vr-preferred-division
|
62
58
|
) {
|
63
59
|
@if pug-units-match($original-size, $vertical-unit) == false {
|
64
|
-
@warn "Incompatible arguments passed to
|
60
|
+
@warn "Incompatible arguments passed to pug-round-up-to-nearest-vertical-unit()";
|
65
61
|
@return false;
|
66
62
|
}
|
67
63
|
@else {
|
@@ -84,38 +80,36 @@
|
|
84
80
|
}
|
85
81
|
}
|
86
82
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
*/
|
83
|
+
// Strip unit of measurement from a numeric value.
|
84
|
+
//
|
85
|
+
// For example, "10px" becomes "10".
|
86
|
+
//
|
87
|
+
// From http://stackoverflow.com/a/12335841
|
88
|
+
//
|
89
|
+
// @param string $number
|
90
|
+
// @return number
|
96
91
|
@function pug-strip-units($number) {
|
97
92
|
$new: $number / ($number * 0 + 1);
|
98
93
|
@return $new;
|
99
94
|
}
|
100
95
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
96
|
+
// Determine whether two or more values use the same unit of measurement.
|
97
|
+
//
|
98
|
+
// Similar to the Sass comparable() function but requires exact match
|
99
|
+
// (such as mm and mm, but not cm and mm).
|
100
|
+
//
|
101
|
+
// Examples:
|
102
|
+
//
|
103
|
+
// @debug pug-units-match(1px, 4px); // true
|
104
|
+
// @debug pug-units-match(1px, 4rem); // false
|
105
|
+
// @debug pug-units-match(1px, 4px, 12px); // true
|
106
|
+
// @debug pug-units-match(1rem, 4rem, 1.2rem); // true
|
107
|
+
// @debug pug-units-match(1rem, 4px, 1.2rem); // false
|
108
|
+
//
|
109
|
+
// @param string $v1 The first value to compare.
|
110
|
+
// @param [...] $others One or more additional values to compare.
|
111
|
+
// @return boolean
|
111
112
|
@function pug-units-match($v1, $others...) {
|
112
|
-
/* Example usages:
|
113
|
-
@debug pug-units-match(1px, 4px); // true
|
114
|
-
@debug pug-units-match(1px, 4rem); // false
|
115
|
-
@debug pug-units-match(1px, 4px, 12px); // true
|
116
|
-
@debug pug-units-match(1rem, 4rem, 1.2rem); // true
|
117
|
-
@debug pug-units-match(1rem, 4px, 1.2rem); // false
|
118
|
-
*/
|
119
113
|
$v1-unit: unit($v1);
|
120
114
|
$return: true;
|
121
115
|
@for $i from 1 through length($others) {
|
@@ -1,54 +1,44 @@
|
|
1
|
-
|
1
|
+
// Pug - Core Mixins
|
2
2
|
|
3
|
-
|
4
|
-
* Align center.
|
5
|
-
*/
|
3
|
+
// Align center.
|
6
4
|
@mixin pug-aligncenter {
|
7
5
|
clear: both;
|
8
6
|
display: block;
|
9
7
|
margin: 0 auto;
|
10
8
|
}
|
11
9
|
|
12
|
-
|
13
|
-
* Align left.
|
14
|
-
*/
|
10
|
+
// Align left.
|
15
11
|
@mixin pug-alignleft {
|
16
12
|
display: inline;
|
17
13
|
float: left;
|
18
14
|
margin-right: $pug-hr-horizontal-unit;
|
19
15
|
}
|
20
16
|
|
21
|
-
|
22
|
-
* Align right.
|
23
|
-
*/
|
17
|
+
// Align right.
|
24
18
|
@mixin pug-alignright {
|
25
19
|
display: inline;
|
26
20
|
float: right;
|
27
21
|
margin-left: $pug-hr-horizontal-unit;
|
28
22
|
}
|
29
23
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
* @see pug-micro-clearfix()
|
34
|
-
*/
|
24
|
+
// Clearfix (alias for pug-micro-clearfix()).
|
25
|
+
//
|
26
|
+
// @see pug-micro-clearfix()
|
35
27
|
@mixin pug-clearfix() {
|
36
28
|
@include pug-micro-clearfix();
|
37
29
|
}
|
38
30
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
* @see pug-dark-bg-with-dark-text
|
51
|
-
*/
|
31
|
+
// Quickly apply appropriate styles to an element for having a dark background.
|
32
|
+
//
|
33
|
+
// This mixin will adjust bg, text and link color.
|
34
|
+
//
|
35
|
+
// @see pug-dark-bg-with-dark-text
|
36
|
+
//
|
37
|
+
// @param string $bg-color
|
38
|
+
// @param string $text-color
|
39
|
+
// @param string $link-default-color
|
40
|
+
// @param string $link-visited-color
|
41
|
+
// @param string $link-hover-color
|
52
42
|
@mixin pug-dark-bg-with-light-text(
|
53
43
|
$bg-color: $pug-bg-color-dark,
|
54
44
|
$text-color: $pug-text-color-light,
|
@@ -71,16 +61,14 @@
|
|
71
61
|
}
|
72
62
|
}
|
73
63
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
* Adapted from HTML5 Boilerplate's .ir class.
|
78
|
-
*/
|
64
|
+
// Image replacement.
|
65
|
+
//
|
66
|
+
// Adapted from HTML5 Boilerplate's .ir class.
|
79
67
|
@mixin pug-image-replacement {
|
80
68
|
background-color: transparent;
|
81
69
|
border: 0;
|
82
70
|
overflow: hidden;
|
83
|
-
|
71
|
+
// IE 6/7 fallback
|
84
72
|
*text-indent: -9999px;
|
85
73
|
&:before {
|
86
74
|
content: "";
|
@@ -90,19 +78,17 @@
|
|
90
78
|
}
|
91
79
|
}
|
92
80
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
* @see pug-dark-bg-with-light-text
|
105
|
-
*/
|
81
|
+
// Quickly apply appropriate styles to an element for having a light background.
|
82
|
+
//
|
83
|
+
// This mixin will adjust bg, text and link color.
|
84
|
+
//
|
85
|
+
// @see pug-dark-bg-with-light-text
|
86
|
+
//
|
87
|
+
// @param string $bg-color
|
88
|
+
// @param string $text-color
|
89
|
+
// @param string $link-default-color
|
90
|
+
// @param string $link-visited-color
|
91
|
+
// @param string $link-hover-color
|
106
92
|
@mixin pug-light-bg-with-dark-text(
|
107
93
|
$bg-color: $pug-bg-color-light,
|
108
94
|
$text-color: $pug-text-color-dark,
|
@@ -125,11 +111,9 @@
|
|
125
111
|
}
|
126
112
|
}
|
127
113
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
* @see http://nicolasgallagher.com/micro-clearfix-hack/
|
132
|
-
*/
|
114
|
+
// Micro-clearfix.
|
115
|
+
//
|
116
|
+
// @see http://nicolasgallagher.com/micro-clearfix-hack/
|
133
117
|
@mixin pug-micro-clearfix() {
|
134
118
|
&:before,
|
135
119
|
&:after {
|
@@ -142,22 +126,21 @@
|
|
142
126
|
*zoom: 1; // IE6/7: Include this rule to trigger hasLayout and contain floats.
|
143
127
|
}
|
144
128
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
*/
|
129
|
+
// Cross-browser default placeholder text color.
|
130
|
+
//
|
131
|
+
// Don't use this within a selector. Just drop it in at the top level of your sass code.
|
132
|
+
//
|
133
|
+
// @see http://css-tricks.com/snippets/css/style-placeholder-text/
|
134
|
+
//
|
135
|
+
// @param string $color
|
153
136
|
@mixin pug-placeholder-color($color) {
|
154
137
|
::-webkit-input-placeholder {
|
155
138
|
color: $color;
|
156
139
|
}
|
157
|
-
:-moz-placeholder {
|
140
|
+
:-moz-placeholder { // Firefox 18-
|
158
141
|
color: $color;
|
159
142
|
}
|
160
|
-
::-moz-placeholder {
|
143
|
+
::-moz-placeholder { // Firefox 19+
|
161
144
|
color: $color;
|
162
145
|
}
|
163
146
|
:-ms-input-placeholder {
|
@@ -165,11 +148,9 @@
|
|
165
148
|
}
|
166
149
|
}
|
167
150
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
* @param number $size
|
172
|
-
*/
|
151
|
+
// Vendor-prefixed tab sizing. Use in elements such as pre.
|
152
|
+
//
|
153
|
+
// @param number $size
|
173
154
|
@mixin pug-tab-size($size: $pug-tab-size) {
|
174
155
|
tab-size: $size;
|
175
156
|
-moz-tab-size: $size;
|
@@ -177,13 +158,27 @@
|
|
177
158
|
white-space: pre-wrap;
|
178
159
|
}
|
179
160
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
161
|
+
// Generates code for sr-only-focusable.
|
162
|
+
//
|
163
|
+
// Used by other Pug mixins (internal use only). Provided
|
164
|
+
// to reduce coupling will enabling legacy support.
|
165
|
+
@mixin _pug-code-for-sr-only-focusable() {
|
166
|
+
&:active,
|
167
|
+
&:focus {
|
168
|
+
position: static;
|
169
|
+
width: auto;
|
170
|
+
height: auto;
|
171
|
+
margin: 0;
|
172
|
+
overflow: visible;
|
173
|
+
clip: auto;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
// Apply to an element to make it accessible only to screen readers. (adapted from Bootstrap 3)
|
178
|
+
//
|
179
|
+
// @see pug-sr-only-focusable()
|
180
|
+
// @see http://getbootstrap.com/css/#helper-classes-screen-readers
|
181
|
+
@mixin pug-sr-only($focusable: false) {
|
187
182
|
position: absolute;
|
188
183
|
width: 1px;
|
189
184
|
height: 1px;
|
@@ -192,30 +187,25 @@
|
|
192
187
|
overflow: hidden;
|
193
188
|
clip: rect(0,0,0,0);
|
194
189
|
border: 0;
|
190
|
+
@if $focusable {
|
191
|
+
@include _pug-code-for-sr-only-focusable;
|
192
|
+
}
|
195
193
|
}
|
196
194
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
195
|
+
// DEPRECATED. Use pug-sr-only($focusable:true) instead.
|
196
|
+
//
|
197
|
+
// Applies sr-only and shows the element again when it's focused. (adapted from Bootstrap 3)
|
198
|
+
//
|
199
|
+
// @see pug-sr-only()
|
200
|
+
// @see http://getbootstrap.com/css/#helper-classes-screen-readers
|
201
|
+
//
|
202
|
+
// @param boolean $include-sr-only
|
203
|
+
// Whether to automatically the sr-only() mixin, which is required for this to work (you would
|
204
|
+
// only set this to false if you had already applied sr-only() to an element receiving
|
205
|
+
// sr-only-focusable).
|
208
206
|
@mixin pug-sr-only-focusable($include-sr-only: true) {
|
209
207
|
@if $include-sr-only == true {
|
210
|
-
@include sr-only;
|
211
|
-
}
|
212
|
-
&:active,
|
213
|
-
&:focus {
|
214
|
-
position: static;
|
215
|
-
width: auto;
|
216
|
-
height: auto;
|
217
|
-
margin: 0;
|
218
|
-
overflow: visible;
|
219
|
-
clip: auto;
|
208
|
+
@include pug-sr-only;
|
220
209
|
}
|
210
|
+
@include _pug-code-for-sr-only-focusable;
|
221
211
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-pug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kamm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|
@@ -49,17 +49,17 @@ require_paths:
|
|
49
49
|
- lib
|
50
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - '>='
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.0.14
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: A collection of mixins and functions for use in Sass/Compass projects.
|