-
Notifications
You must be signed in to change notification settings - Fork 0
/
head.scss
193 lines (150 loc) · 3.09 KB
/
head.scss
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
$version: 'v0.3.2';
$font: 14px/1.5 Consolas,monaco,monospace;
$color-base: #673AB7;
$color-meta: #9C27B0;
$color-link: #E91E63;
$color-style: #FF5722;
$color-script: #ff9800;
$size: 3.2em;
@mixin base(){
display: block;
font: $font;
background: $color-base;
user-select: none;
color: #FFF;
padding: 3px 6px;
border-radius: 3px;
margin: 2px;
}
@mixin singleline(){
white-space: nowrap;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
//force visible overflows
html, body{ overflow: initial }
html{
border: 10px solid $color-base;
padding: 10px;
height: auto;
min-height: 100%;
}
//hide any element named "css-head-inspector"
//using the bookmarlet styles will be injected using this name
link[name="css-head-inspector"],
styles[name="css-head-inspector"]{
display: none !important
}
title,
link,
title,
meta,
style,
script{
//super high value to ensure top level visibility
z-index: 99999999;
@include base();
@include singleline();
//extra bonus :D
//make whole content visible while mouse down using :active
&:active{
white-space: normal;
}
}
html,
head,
body{
display: block;
position: relative;
padding-top: 32px;
padding-bottom: 32px;
margin: 0;
&:before,
&:after{
content: '';
position: absolute;
@include base();
@include singleline();
//super high value to ensure top level visibility
z-index: 99999999;
}
&:before{ top:0; left: 0 }
&:after{ bottom: 0; left: 0 }
}
html{
&:before{ content: '<html ! css-head-inspector#{$version}>'; }
&:after{ content: '</html>' }
}
head{
&:before{ content: '<head>' }
&:after{ content: '</head>' }
}
body{
&:before{ content: '<body>' }
&:after{ content: '</body>' }
}
meta{
background-color: $color-meta;
&::after{
content: '<meta ... />';
}
&[charset]::after{
content: '<meta charset="' attr(charset) '">';
}
&[http-equiv][content]::after{
content: '<meta http-equiv="' attr(http-equiv) '" content="' attr(content) '">';
}
&[name][content]::after{
content: '<meta name="' attr(name) '" content="' attr(content) '">';
}
&[name][value]::after{
content: '<meta name="' attr(name) '" value="' attr(value) '">';
}
&[property][content]::after{
content: '<meta property="' attr(property) '" content="' attr(content) '">';
}
}
title {
font-size: 26px;
font-weight: bold;
&:empty:before{
content: 'Untitled';
}
}
link{
background-color: $color-link;
&[rel]:not([src]):before {
content: '<link>';
}
&[rel][href]:before {
content: '<link rel="' attr(rel) '" href="' attr(href) '"';
}
&:after{
content: ' />';
}
}
script{
background-color: $color-script;
&:not([src]):before {
content: '<script>';
}
&[src]:before {
content: '<script src="' attr(src) '">';
}
&:after {
content: '</script>';
}
}
style{
background-color: $color-style;
&:not([src]):before {
content: '<st''yle>';
}
&[src]:before {
content: '<style src="' attr(src) '">';
}
&:after {
content: '</st''yle>';
}
}