-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvg.css
More file actions
241 lines (214 loc) · 6.2 KB
/
Copy pathsvg.css
File metadata and controls
241 lines (214 loc) · 6.2 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
/*------------------------------------------------------------------------------------------------*
Clarification for self:
Since this pattern is intented for use on logos, and since logos are an integral part of
branding, this pattern is not ONLY intended as a CSS fallback.
The markup is really important to provide an image of the logo even if CSS fails or is cut.
However, since these patterns are intended for use with the CSS Mustard Cut (original) then
styles for older browsers are omitted here since they won't load.
\*------------------------------------------------------------------------------------------------*/
/*
Make the container fit the content.
Note: `*:not(body)` avoids clash with Modernizr-added class.
1. IE9 needs this to avoid extra height. (Others too?)
*/
.svg:not(html) {
display: inline-block;
max-width: 100%;
vertical-align: middle;
/* [1] */ }
/*
Zero out any inherited margins and padding for child elements.
Note: `*:not(body)` avoids clash with Modernizr-added class.
*/
.svg > *:not(body) {
margin: 0;
padding: 0; }
/*
Set the default link styles based on the settings.
The mixin allows variants to be easily generated.
*/
/*
1. Make the link fit the content.
2. Provide positioning context for the pseudo element.
3. Remove underline on some older browsers (Android 2.x mainly)
4. IE9 needs this to avoid extra height. (Others too?)
*/
.svg .svg__link {
display: inline-block;
/* [1] */
position: relative;
/* [2] */
text-decoration: none;
/* [3] */
vertical-align: middle;
/* [4] */
background-color: transparent;
border-width: 0;
border-style: solid;
border-color: #333; }
.svg .svg__link:hover,
.svg .svg__link:active,
.svg .svg__link:focus {
text-decoration: none;
background-color: transparent;
border-width: 0;
border-style: 0;
border-color: 0; }
/*
Objects inside links prevent the link from functioning, this hack fixes
that. `pointer-events: none;` would solve it but support isn't good
enough (http://caniuse.com/#search=pointer-events).
1. This is needed for IE9+ or hover effects don't work over images
embedded in the SVG.
*/
.svg .svg__link:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: transparent;
/* [1] */ }
/*
1. Remove gap below.
*/
.svg .svg__image {
vertical-align: top;
/* [1] */ }
/*
1. Prevent pointer-events blocking link action in supporting browsers.
*/
.svg .svg__link .svg__image {
pointer-events: none;
/* [1] */ }
/*
Allows the fallback text to show ONLY if CSS is available AND the SVG fails to load (the PNG is
hidden if SVG is supported so that won't be an issue).
*/
.svg .svg__fallback-text-alpha::before {
content: attr(data-content); }
/*
Hide the fallback text ONLY if CSS is available (but not from screenreaders).
*/
.svg .svg__fallback-text-beta {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px; }
/*------ Fixed Height ------*/
/*
Set this to your required height.
If you need more variants, create separate modification classes instead.
*/
/*
NOTE: FF 32- (XP and Win8) seems to set a 3xheight width on initial page load / force refresh.
If any relevent properties are altered or page is normally refreshed, it snaps to the correct
width. UNRESOLVED.
*/
.svg--fixed-height,
.svg--fixed-height .svg__link,
.svg--fixed-height .svg__image {
height: 100px;
max-height: 100px; }
/*
1. Allow pattern to contract.
*/
.svg--fixed-height .svg__link,
.svg--fixed-height .svg__image {
max-width: 100%;
/* [1] */ }
/*
Allow the fallback image to scale properly.
1. IE6 - can be removed if unnecessary.
*/
.svg--fixed-height .svg__fallback-image {
max-width: 100%;
max-height: 100px;
height: auto; }
.svg--fixed-height .svg__link {
padding: 0;
border-width: 0; }
.svg--fixed-height .svg__link:hover,
.svg--fixed-height .svg__link:active,
.svg--fixed-height .svg__link:focus {
border-width: 0; }
/*------ Fluid ------*/
/*
1. Force the svg wrapper and link to fill their containers.
*/
.svg--fluid,
.svg--fluid .svg__link {
display: block;
/* [1] */
width: 100%;
/* [1] */ }
/*
1. Force the object and fallback image to proportionally fill their
containers, overriding attribute values.
*/
.svg--fluid .svg__image,
.svg--fluid .svg__fallback-image {
height: auto;
/* [1] */
width: 100%;
/* [1] */ }
/*------------------------------------------------------------------------------------------------*/
.svg--fixed-height--small,
.svg--fixed-height--small .svg__link,
.svg--fixed-height--small .svg__image {
height: 50px;
max-height: 50px; }
/*
1. Allow pattern to contract.
*/
.svg--fixed-height--small .svg__link,
.svg--fixed-height--small .svg__image {
max-width: 100%;
/* [1] */ }
/*
Allow the fallback image to scale properly.
1. IE6 - can be removed if unnecessary.
*/
.svg--fixed-height--small .svg__fallback-image {
max-width: 100%;
max-height: 50px;
height: auto; }
.svg--fixed-height--small .svg__link {
padding: 0;
border-width: 0; }
.svg--fixed-height--small .svg__link:hover,
.svg--fixed-height--small .svg__link:active,
.svg--fixed-height--small .svg__link:focus {
border-width: 0; }
.svg--fixed-height--percent,
.svg--fixed-height--percent .svg__link,
.svg--fixed-height--percent .svg__image {
height: 100%;
max-height: 100%; }
/*
1. Allow pattern to contract.
*/
.svg--fixed-height--percent .svg__link,
.svg--fixed-height--percent .svg__image {
max-width: 100%;
/* [1] */ }
/*
Allow the fallback image to scale properly.
1. IE6 - can be removed if unnecessary.
*/
.svg--fixed-height--percent .svg__fallback-image {
max-width: 100%;
max-height: 100%;
height: auto; }
.svg--fixed-height--percent .svg__link {
padding: 0;
border-width: 0; }
.svg--fixed-height--percent .svg__link:hover,
.svg--fixed-height--percent .svg__link:active,
.svg--fixed-height--percent .svg__link:focus {
border-width: 0; }