-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.xhtml
142 lines (142 loc) · 5.79 KB
/
index.xhtml
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Downstyler: a tool to fight CSS bloat</title>
<link rel="stylesheet" href="downstyler.css" />
<style>
body * {
text-align: center;
hyphens: auto;
}
p:not([class]) {
font-family: sans-serif;
}
.subtitle {
color: grey;
font-size: 1.3em;
font-style: italic;
}
.bookmarklet {
line-height: 2em;
}
.bookmarklet a {
border: 1px solid silver;
border-radius: 0.3em;
background-color: #eee;
padding: 0.3em;
margin: 0.5em;
}
pre.highlight {
text-align: left;
margin-top: 1em;
color: SteelBlue;
}
pre.highlight .str {
color: Coral;
}
</style>
</head>
<body>
<h1>Downstyler</h1>
<p class="subtitle">
A tool to fight CSS bloat.
</p>
<p>
Learn more in the <a href="https://github.com/waldyrious/downstyler#readme">README</a>.
</p>
<h2>Usage</h2>
<p>
<strong class="bookmarklet">
<a href="javascript:document.body.removeAttribute('background');
for(ss of document.styleSheets){void(ss.disabled=true)}
for(el of document.getElementsByTagName('*')){void(el.removeAttribute('style'));void(el.removeAttribute('bgColor'));}
for(tb of document.getElementsByTagName('table')){tb.border=0}
for(ft of document.getElementsByTagName('font')){for(at of ft.attributes){ft.removeAttribute(at.name);}}
document.head.insertAdjacentHTML('beforeend',
'<link rel="stylesheet" type="text/css" href="'+
(window.location.protocol.startsWith('http')?window.location.protocol:'http:')+
'//raw.githack.com/waldyrious/downstyler/master/downstyler.css'+
'" />'
)">downstyle!</a>
</strong>
</p>
<p>
Just drag the link above to your browser's bookmarks toolbar.
<br />
You can then use it to instantly strip down the styling of any page on the web.
<br />
(Hint: click the link to try it on this page!)
</p>
<p>✻</p>
<p>
Alternative bookmarklets are available for a sans-serif mode,
<br/>
as well as a reading mode that emulates a "paper sheet" look:
</p>
<p>
<strong class="bookmarklet">
<a href="javascript:document.body.removeAttribute('background');
for(ss of document.styleSheets){void(ss.disabled=true)}
for(el of document.getElementsByTagName('*')){void(el.removeAttribute('style'));void(el.removeAttribute('bgColor'));}
for(tb of document.getElementsByTagName('table')){tb.border=0}
for(ft of document.getElementsByTagName('font')){for(at of ft.attributes){ft.removeAttribute(at.name);}}
document.head.insertAdjacentHTML('beforeend',
'<link rel="stylesheet" type="text/css" href="'+
(window.location.protocol.startsWith('http')?window.location.protocol:'http:')+
'//raw.githack.com/waldyrious/downstyler/master/downstyler.css'+
'" />'
);
document.head.insertAdjacentHTML('beforeend',
'<style>
body { font-family: sans-serif; font-weight: 300; }
</style>'
)">downstyle (sans-serif)</a>
<a href="javascript:document.body.removeAttribute('background');
for(ss of document.styleSheets){void(ss.disabled=true)}
for(el of document.getElementsByTagName('*')){void(el.removeAttribute('style'));void(el.removeAttribute('bgColor'));}
for(tb of document.getElementsByTagName('table')){tb.border=0}
for(ft of document.getElementsByTagName('font')){for(at of ft.attributes){ft.removeAttribute(at.name);}}
document.head.insertAdjacentHTML('beforeend',
'<link rel="stylesheet" href="'+
(window.location.protocol.startsWith('http')?window.location.protocol:'http:')+
'//raw.githack.com/waldyrious/downstyler/master/downstyler.css'+
'" />'
);
document.head.insertAdjacentHTML('beforeend',
'<style>
html { background: #ddd; }
body {
background: linear-gradient( to right, #f9f9f9, #fff 10%, #fff 90%, #f9f9f9 100% );
filter: sepia(3%) saturate(85%) contrast(98%);
max-width: 40em; padding: 1em 5em; margin: 10px auto; border-radius: 3px; box-shadow: 0 0 7px -3px;
}
h1, h2, h3, h4, h5, h6 { text-align: initial; }
</style>'
)">paperlike</a>
</strong>
</p>
<p>✻</p>
<p>
Downstyler can also be used as a regular stylesheet.
<br />
Download
<strong><a href="https://raw.githubusercontent.com/waldyrious/downstyler/master/downstyler.css">
downstyler.css<!--
--></a></strong>,
or include the following code in your HTML<br />
(courtesy of the <a href="https://raw.githack.com/">RawGitHack</a> service):
<br />
<pre class="highlight"><link rel=<span class="str">"stylesheet"</span><br/><!--
-->href=<span class="str">"https://raw.githack.com/waldyrious/downstyler/master/downstyler.css"</span> /></pre>
</p>
<h2>Demo</h2>
<p>
For a more comprehensive demonstration of how pages using Downstyler look like,
<br/>
compare <a href="comparisons/demo-raw.xhtml">this demo page using no styling at all</a>,
with <a href="comparisons/demo-downstyler.xhtml">the same page using Downstyler</a>.
</p>
</body>
</html>