forked from dhg/Skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes_example.html
272 lines (252 loc) · 9.98 KB
/
themes_example.html
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Skeleton Themes example</title>
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/skeleton.css">
<link rel="stylesheet" href="../css/themes/skeleton-blue.css">
<link rel="stylesheet" href="../css/themes/soothing-orange.css">
<link rel="stylesheet" href="../css/themes/crimson-red.css">
<link rel="stylesheet" href="../css/themes/hacker-purple.css">
<!-- Raleway font from Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600&display=swap" rel="stylesheet">
<style>
*:not(.button, a) {
--color-transition: 200ms ease-in-out;
transition: color var(--color-transition),
background-color var(--color-transition),
border-color var(--color-transition);
}
h1,
h2 {
text-align: center;
margin-top: 5vh;
}
h4 {
margin-top: 3vh;
}
.code-block {
white-space: pre;
word-wrap: break-word;
}
pre {
overflow: auto;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<h2>Skeleton Themes Example</h2>
<hr>
</div>
<div class="row">
<div class="eight columns">
<p>
This example goes through the differing things with the
Skeleton Themes implementation. Everything else is the same,
and is further described at
<a href="http://getskeleton.com/">getskeleton.com</a>.
</p>
<p>
You can select one of the template themes using the dropdown
menu to the right.
</p>
</div>
<div class="four columns">
<form action="return false">
<select onchange="changeTheme(this)">
<option value="crimson-red">Crimson Red</option>
<option value="hacker-purple">Hacker Purple</option>
<option value="skeleton-blue" selected="selected">Skeleton Blue</option>
<option value="soothing-orange">Soothing Orange</option>
</select>
</form>
</div>
</div>
<div class="row">
<h4>Theme Elements</h4>
</div>
<div class="row">
<p>
A Skeleton theme is defined by a set of variables that can be
exchanged in order to change theme. These variables are defined
in their own themes class which can be applied to a parent
element which contains everything you want the theme to affect.
This site does this by setting the class of the
<code>body</code> element to one of these themes, and exchanging
that class when you change theme.
</p>
<p>
A theme is composed of different sets of variables that applies
to different things. For a start we can look at the definition
of the <i>Skeleton Blue</i> theme, which is the original look.
</p>
<pre>
<code class="code-block">
/* Classic bone chilling blue */
.skeleton-blue {
/* Colors used for primary elements such as primary buttons and links */
--primary: #1EAEDB;
--primary-focus: #0FA0CE;
--primary-background: #33C3F0;
--primary-text: #FFF;
/* The color of non-primary elements such as standard buttons */
--muted: #555;
--muted-border: #bbb;
--muted-focus: #333;
--muted-border-focused: #888;
/* Text color on page for all elements */
--text: #222;
/* Page background color and highlights */
--background: #FFF;
--background-highlight: #E1E1E1;
/* Code blocks */
--code: #222;
--code-background: #F1F1F1;
--code-border: #E1E1E1;
/* Forms */
--form-background: #FFF;
--form-border: #D1D1D1;
}
</code>
</pre>
<p>
We'll go through the groups one by one.
</p>
<p>
The <code>--primary</code> group defines the primary color of
accents on the site. For the Skeleton Blue theme this is the
light blue color. These colors applies to primary buttons and
links. Note that there also is a definition for the <i>text
color of primary elements</i>, such as the text color of primary
buttons.
</p>
<p>
The <code>--muted</code> group defines how normal elements
should look, such as normal buttons. This also includes how the
elements should look when they are hovered over.
</p>
<p>
The <code>--text</code> definition is for how overall text
should look in the theme. This is usually black or white, but
can be changed as you please.
</p>
<p>
The <code>--background</code> group defines what color the
background should be, and some accents such as horizontal lines.
</p>
We'll carry on with these explanations in their corresponding section.
</div>
<div class="row">
<h4>Buttons</h4>
</div>
<div class="row">
<div class="eight columns">
<p>Buttons can take the form of a <i>primary</i> or <i>normal</i>
button. The primary buttons follow the themes colorscheme for
primary elements. The normal buttons follows the themes
colorscheme for muted elements.</p>
</div>
<div class="four columns">
<row>
<button class="button button-primary">Primary button</button>
</row>
<row>
<button class="button">Normal button</button>
</row>
</div>
</div>
<div class="row">
<h4>Links</h4>
<p>
Links also follows the <code>--primary</code> color definitions.
</p>
<a href=https://github.com/dhg/Skeleton"">
Skeleton repository on Github
</a>
</div>
<div class="row">
<h4>Forms</h4>
<p>
Forms work the same as they always have, but now things such as
borders and buttons follows the color scheme. The background and
border colors of forms are defined in the <code>--form</code> group.
</p>
</div>
<div class="row">
<form>
<div class="row">
<div class="six columns">
<label for="exampleEmailInput">Your email</label>
<input class="u-full-width" type="email" placeholder="test@mailbox.com" id="exampleEmailInput">
</div>
<div class="six columns">
<label for="exampleRecipientInput">Reason for contacting</label>
<select class="u-full-width" id="exampleRecipientInput">
<option value="Option 1">Questions</option>
<option value="Option 2">Admiration</option>
<option value="Option 3">Can I get your number?</option>
</select>
</div>
</div>
<label for="exampleMessage">Message</label>
<textarea class="u-full-width" placeholder="Hi Dave …" id="exampleMessage"></textarea>
<label class="example-send-yourself-copy">
<input type="checkbox">
<span class="label-body">Send a copy to yourself</span>
</label>
<input class="button-primary" type="submit" value="Submit">
</form>
</div>
<div class="row">
<div class="six columns">
<h4>Code</h4>
<p>
Code styling is the same as before; just wrap inline code in
a <code><code></code> element, and wrap that in a
<code><pre></code> element to get a code block.
</p>
<p>
Code can be stylized by changing the color of the text, the
background color and the border around it. These colors are
defined in the <code>--code</code> group.
</p>
</div>
<div class="six columns">
<pre>
<code class="code-block">
<div class="row">
<h4>Code</h4>
</div>
<div class="row">
<div class="six columns">
<p>
Code styling is the same as before;
just wrap inline code in a
<code><code></code> element, and
wrap that in a
<code><pre></code> element to get
a code block.
</p>
</div>
<div class="six columns"></div>
</div>
</code>
</pre>
</div>
</div>
</div>
<script>
// Apply the theme from the selected instance of the form to the whole body
function changeTheme(element) {
document.body.className = "";
document.body.classList.add(element.value)
}
</script>
</body>
</html>