typey 1.0.0.beta.5 → 1.0.0.beta.6
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 +4 -4
- data/README.md +134 -416
- data/stylesheets/_typey.scss +13 -7
- data/stylesheets/typey/_defaults.scss +13 -39
- data/stylesheets/typey/_font-stacks.scss +0 -14
- data/stylesheets/typey/functions/_depreciated.scss +55 -0
- data/stylesheets/typey/functions/_em-calculators.scss +41 -0
- data/stylesheets/typey/{_weight.scss → functions/_extras.scss} +10 -8
- data/stylesheets/typey/functions/_helpers.scss +32 -0
- data/stylesheets/typey/functions/_outputters.scss +83 -0
- data/stylesheets/typey/functions/_sizers.scss +117 -0
- data/stylesheets/typey/functions/_validators.scss +77 -0
- data/stylesheets/typey/mixins/_define-type-sizing.scss +49 -0
- data/stylesheets/typey/mixins/_font-size.scss +24 -0
- data/stylesheets/typey/mixins/_line-height.scss +25 -0
- data/stylesheets/typey/{_margin.scss → mixins/_margin.scss} +30 -37
- data/stylesheets/typey/{_padding.scss → mixins/_padding.scss} +30 -37
- data/stylesheets/typey/mixins/_type-layout.scss +53 -0
- data/typey.gemspec +2 -2
- metadata +16 -10
- data/stylesheets/typey/_font-size.scss +0 -56
- data/stylesheets/typey/_helpers.scss +0 -171
- data/stylesheets/typey/_line-height.scss +0 -63
- data/stylesheets/typey/_type-layout.scss +0 -49
@@ -1,63 +0,0 @@
|
|
1
|
-
// Generate a value to be used as line-height from either:
|
2
|
-
// a) a multiple of $base-line-height
|
3
|
-
// b) a static px or pt value
|
4
|
-
//
|
5
|
-
// Example usage with multiple:
|
6
|
-
// line-height: line-height(2);
|
7
|
-
// Example usage with static value:
|
8
|
-
// line-height: line-height(18px);
|
9
|
-
//
|
10
|
-
// @param number $x
|
11
|
-
// Multiple of line height to be used or px/pt value to be converted.
|
12
|
-
// @param number|string $context
|
13
|
-
// (optional) Only used if em is the $base-unit. The value of the elements/parents
|
14
|
-
// font-size if it differs from $base-font-size. Specified as a t-shirt size or
|
15
|
-
// value in px.
|
16
|
-
//
|
17
|
-
// @return number
|
18
|
-
// The calculated height in $base-unit.
|
19
|
-
@function line-height($x, $context: $base-font-size) {
|
20
|
-
@if type-of($x) == "number" and unitless($x) {
|
21
|
-
@return output-from-multiplier($x, $context);
|
22
|
-
}
|
23
|
-
@if type-of($x) == "number" and not unitless($x) {
|
24
|
-
@if unit($x) == px {
|
25
|
-
@return convert-unit($x, $context);
|
26
|
-
}
|
27
|
-
@else {
|
28
|
-
@error "line-height() only accepts unitless numbers or values in px";
|
29
|
-
}
|
30
|
-
}
|
31
|
-
@else {
|
32
|
-
@error "line-height() only accepts unitless numbers or values in px";
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
// Define line-height (with fallback).
|
37
|
-
// This is only necessary to use if you want to provide fallbacks when you are
|
38
|
-
// using rem as $base-unit.
|
39
|
-
//
|
40
|
-
// @param number $x
|
41
|
-
// Multiple of line height to be used or px/pt value to be converted.
|
42
|
-
// @param number|string $context
|
43
|
-
// (optional) Only used if em is the $base-unit. The value of the elements/parents
|
44
|
-
// font-size if it differs from $base-font-size. Specified as a t-shirt size or
|
45
|
-
// value in px.
|
46
|
-
@mixin line-height($x, $context: $base-font-size) {
|
47
|
-
@if $base-unit == rem {
|
48
|
-
@if $rem-fallback == true {
|
49
|
-
@if type-of($x) == "number" and unitless($x) {
|
50
|
-
line-height: $x * $base-line-height;
|
51
|
-
}
|
52
|
-
@if type-of($x) == "number" and not unitless($x) {
|
53
|
-
@if unit($x) == px {
|
54
|
-
line-height: $x;
|
55
|
-
}
|
56
|
-
@else {
|
57
|
-
@error "line-height() only accepts unitless numbers or values in px";
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|
62
|
-
line-height: line-height($x, $context);
|
63
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
// Define a type layout (font-size and line-height).
|
2
|
-
//
|
3
|
-
// @param number|string $size
|
4
|
-
// A size from the $font-size map or a px value.
|
5
|
-
// @param number $x
|
6
|
-
// Multiple of line height to be used or px value to be converted.
|
7
|
-
// @param number|string $context
|
8
|
-
// (optional) Only used if em is the $base-unit. The value of the elements/parents
|
9
|
-
// font-size if it differs from $base-font-size. Specified as a t-shirt size or
|
10
|
-
// value in px.
|
11
|
-
@mixin type-layout($size, $x, $context: $size) {
|
12
|
-
@if $base-unit == rem {
|
13
|
-
@if $rem-fallback == true {
|
14
|
-
@if type-of($size) == "string" {
|
15
|
-
$map-size: map-get($font-size, $size);
|
16
|
-
font-size: $map-size;
|
17
|
-
}
|
18
|
-
@if type-of($size) == "number" and not unitless($size) {
|
19
|
-
$unit: unit($size);
|
20
|
-
@if $unit == px {
|
21
|
-
font-size: $size;
|
22
|
-
}
|
23
|
-
@else {
|
24
|
-
@warn "font-size() only accepts values in px";
|
25
|
-
}
|
26
|
-
}
|
27
|
-
@if type-of($x) == "number" and unitless($x) {
|
28
|
-
line-height: $x * $base-line-height;
|
29
|
-
}
|
30
|
-
@if type-of($x) == "number" and not unitless($x) {
|
31
|
-
line-height: $x;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
@if $base-unit == rem or $base-unit == px {
|
36
|
-
font-size: font-size($size);
|
37
|
-
line-height: line-height($x);
|
38
|
-
}
|
39
|
-
@if $base-unit == em {
|
40
|
-
@if $size == $context {
|
41
|
-
font-size: font-size($size, $base-font-size);
|
42
|
-
line-height: line-height($x, $size);
|
43
|
-
}
|
44
|
-
@else {
|
45
|
-
font-size: font-size($size, $context);
|
46
|
-
line-height: line-height($x, $size);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|