forked from MarcDiethelm/such.less
-
Notifications
You must be signed in to change notification settings - Fork 0
/
20-typography.less
110 lines (88 loc) · 2.11 KB
/
20-typography.less
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
/**
* "such.less" CSS boilerplate framework
* 20-typography.less
* https://github.com/MarcDiethelm/such.less
* License: MIT
* Copyright 2014 Marc Diethelm, Simon Harte
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BASE TYPOGRAPHY
// Dependencies:
// - 00-variables.less
#type {
// set default variables, overwrite in sub bundles if needed
@font-family : @font-default;
@font-weight : normal;
// optimised text rendering
.rendering(@_) {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#title {
@font-family: @font-title;
.style() {
font-family: @font-family;
font-weight: @font-weight;
}
// applies to all below //
.size(@_) {
&:extend(.class-title);
}
.size('default') {
font-size: 18px;
line-height: 20px;
}
.size('page') {
font-size: 28px;
line-height: 34px;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#copy {
.style() {
font-family: @font-family;
font-weight: @font-weight;
}
// applied to all below //
.size(@_) {
&:extend(.class-copy);
}
.size('default', ...) {
font-size: 13px;
line-height: 17px;
}
.size('small', ...) {
font-size: 11px;
line-height: 14px;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#link {
@color: @color-link;
// applies to all below //
.style(@_) {
color: @color;
text-decoration: none;
}
.style('default') {
&:hover {
text-decoration: underline;
}
}
.style('hilited') {
&:hover {
text-decoration: none;
color: hotpink;
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BASE TYPO STYLE CLASSES TO EXTEND
.class-title {
#type > #title > .style;
}
.class-copy {
#type > #copy > .style;
}