Skip to content

Commit 2192bb3

Browse files
committed
Auto merge of #2109 - Turbo87:style-files, r=locks
Split up styles into per-route/component style files This makes the styles of a component/route a lot easier to find and maintain. I would like to eventually use https://github.com/salsify/ember-css-modules for this project, which will ensure proper scoping too. r? @locks
2 parents 1c1fd34 + 7f5c164 commit 2192bb3

17 files changed

+680
-682
lines changed

app/styles/_buttons.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@mixin vertical-gradient($start, $end) {
2+
background: $end;
3+
background: -moz-linear-gradient(top, $start 0%, $end 100%);
4+
background: -webkit-gradient(linear, left top, left bottom,
5+
color-stop(0%,$start),
6+
color-stop(100%,$end));
7+
background: -webkit-linear-gradient(top, $start 0%,$end 100%);
8+
background: -ms-linear-gradient(top, $start 0%,$end 100%);
9+
background: linear-gradient(to bottom, $start 0%,$end 100%);
10+
}
11+
12+
@mixin button($start, $end) {
13+
$start_dark: darken($start, 5%);
14+
$end_dark: darken($end, 5%);
15+
$start_light: lighten($start, 5%);
16+
$end_light: lighten($end, 5%);
17+
18+
padding: 15px 40px;
19+
display: inline-block;
20+
color: $main-color;
21+
text-decoration: none;
22+
font-weight: bold;
23+
border: none;
24+
outline: 0;
25+
border-radius: 30px;
26+
@include vertical-gradient($start, $end);
27+
28+
img, svg {
29+
float: left;
30+
display: inline-block;
31+
margin-right: 10px;
32+
}
33+
34+
&:hover, &:focus { @include vertical-gradient($start_dark, $end_dark); outline: 0; }
35+
&.active { @include vertical-gradient($start_dark, $end_dark); outline: 0; }
36+
&[disabled] {
37+
@include vertical-gradient($start_light, $end_light);
38+
color: $main-color-light;
39+
}
40+
}
41+
42+
.yellow-button {
43+
@include button(#fede9e, #fdc452);
44+
vertical-align: middle;
45+
}
46+
47+
button.small {
48+
padding: 10px 20px;
49+
border-radius: 30px;
50+
}
51+
52+
.tan-button {
53+
@include button(rgb(232, 227, 199), rgb(214, 205, 153));
54+
}

app/styles/app.scss

Lines changed: 14 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,22 @@ $main-bg-dark: #edebdd;
88
$gray-border: #d5d3cb;
99
$link-color: rgb(0, 172, 91);
1010

11+
@import "buttons";
12+
13+
@import "application";
1114
@import "home";
15+
@import "catch-all";
16+
@import "category-slugs";
1217
@import "crate";
18+
@import "crate/version";
19+
@import "components/crate-toml-copy";
20+
@import "components/flash-message";
21+
@import "components/pagination";
22+
@import "dashboard";
23+
@import "index";
24+
@import "loading";
1325
@import "me";
26+
@import "search";
1427

1528
* {
1629
box-sizing: border-box;
@@ -41,101 +54,8 @@ body > div {
4154
}
4255

4356
#noscript {
44-
color: white;
45-
padding: 10px 0;
46-
}
47-
48-
#main {
49-
display: flex;
50-
flex-direction: column;
51-
52-
margin-bottom: 10px;
53-
background-color: $main-bg;
54-
padding: 15px;
55-
border-radius: 10px;
56-
box-shadow: 0px 0px 5px 2px #3b6837;
57-
border: 5px solid #62865f;
58-
color: $main-color;
59-
}
60-
61-
#header {
6257
color: white;
63-
position: relative;
64-
height: 100px;
65-
display: flex;
66-
align-items: center;
67-
justify-content: space-between;
68-
69-
a {
70-
color: white; text-decoration: none;
71-
&:hover { color: darken(white, 15%); }
72-
}
73-
74-
.sep { margin: 0 10px; color: darken($html-bg, 10%); }
75-
.nav, .menu {
76-
text-align: right;
77-
margin-right: 5px;
78-
}
79-
80-
.menu {
81-
flex-grow: 2;
82-
display: none;
83-
}
84-
.menu ul.dropdown {
85-
right: 0;
86-
left: auto;
87-
min-width: 200px;
88-
}
89-
90-
button {
91-
background: none;
92-
border: 0;
93-
padding: 10px 0;
94-
95-
&.active {
96-
background: rgb(42, 79, 39);
97-
box-shadow: inset -2px 2px 4px 0px rgb(36, 61, 38);
98-
}
99-
100-
img {
101-
vertical-align: top;
102-
}
103-
}
104-
105-
.current-user-links {
106-
left: auto;
107-
right: 0;
108-
min-width: 200px;
109-
}
110-
#doc-links {
111-
left: auto;
112-
min-width: 150px;
113-
}
114-
form.search {
115-
display: flex;
116-
flex-grow: 1;
117-
}
118-
@media only screen and (max-width: 820px) {
119-
form.search { display: none; }
120-
}
121-
@media only screen and (max-width: 900px) {
122-
.menu { display: block; }
123-
.nav { display: none; }
124-
}
125-
}
126-
127-
#header input.search, #mobile-search input.search {
128-
font-size: 90%;
129-
border: none;
130-
color: black;
131-
margin-left: 30px;
132-
padding: 5px 5px 5px 25px;
133-
background-color: white;
134-
background-image: url('/assets/search.png');
135-
background-repeat: no-repeat;
136-
background-position: 6px 6px;
137-
background-size: 14px 15px;
138-
border-radius: 15px;
58+
padding: 10px 0;
13959
}
14060

14161
form.search label {
@@ -147,26 +67,6 @@ form.search label {
14767
overflow: hidden;
14868
}
14969

150-
#header input.search {
151-
width: 100%;
152-
margin-left: 16px;
153-
margin-right: 16px;
154-
}
155-
156-
#mobile-search {
157-
display: none;
158-
margin-bottom: 10px;
159-
margin-left: 5px;
160-
margin-right: 5px;
161-
input.search {
162-
width: 100%;
163-
margin: 0;
164-
}
165-
@media only screen and (max-width: 820px) {
166-
display: block;
167-
}
168-
}
169-
17070
input.search {
17171
box-shadow: none;
17272
}
@@ -189,34 +89,6 @@ span.small {
18989
color: rgb(166, 0, 0)
19090
}
19191

192-
div.loading-state {
193-
text-align: center;
194-
height: 65vh;
195-
padding-top: 30vh;
196-
}
197-
span.loading {
198-
display: inline-block;
199-
width: 16px;
200-
height: 16px;
201-
background-image: url(/assets/ajax-loader.gif);
202-
}
203-
204-
#flash {
205-
display: none;
206-
font-weight: bold;
207-
font-size: 110%;
208-
background-color: rgb(255, 213, 213);
209-
border: 2px solid rgb(228, 136, 136);
210-
text-align: center;
211-
margin: 0 0 10px 0;
212-
padding: 10px;
213-
border-radius: 5px;
214-
215-
&.shown {
216-
display: block;
217-
}
218-
}
219-
22092
a {
22193
color: $link-color;
22294
text-decoration: none;
@@ -229,46 +101,13 @@ a {
229101
&:hover { color: darken($main-color-light, 10%); }
230102
}
231103

232-
.after-main-links {
233-
margin: 40px;
234-
235-
a { color: white; }
236-
a:hover { color: darken(white, 10%); }
237-
.sep { margin: 0 10px; color: darken($html-bg, 10%); }
238-
239-
@media only screen and (max-width: 450px) {
240-
margin: 20px;
241-
.sep { display: none; }
242-
display: flex;
243-
flex-direction: column;
244-
245-
a {
246-
width: 50%;
247-
font-size: 110%;
248-
padding: 5px;
249-
&:not(:first-child) { border-top: 1px solid darken($html-bg, 10%); }
250-
}
251-
}
252-
}
253-
254104
pre {
255105
background: $main-color;
256106
color: white;
257107
padding: 20px;
258108
font-family: Consolas, Monaco, 'Andale Mono', monospace;
259109
}
260110

261-
.pagination {
262-
img, svg { vertical-align: middle; }
263-
264-
.next.active,
265-
.prev.active,
266-
.next:hover,
267-
.prev:hover {
268-
background: none;
269-
}
270-
}
271-
272111
button.dropdown, a.dropdown {
273112
color: inherit;
274113
cursor: pointer;
@@ -320,16 +159,6 @@ ul.dropdown {
320159

321160
.hidden { display: none; }
322161

323-
.fork-me {
324-
position: absolute;
325-
top: 0;
326-
right: 0;
327-
328-
@media only screen and (max-width: 1180px) {
329-
display: none;
330-
}
331-
}
332-
333162
@media only screen and (max-width: 400px) {
334163
h1 { font-size: 1.5em; }
335164
}
@@ -341,15 +170,6 @@ h1 {
341170
}
342171
}
343172

344-
#p404 {
345-
font-size: 120%;
346-
line-height: 3em;
347-
input {
348-
width: 100%;
349-
padding: 5px;
350-
}
351-
}
352-
353173
.arrow-in-list svg {
354174
background: #fff;
355175
}
@@ -362,9 +182,3 @@ abbr[title] {
362182
text-decoration: none;
363183
border-bottom: 1px dotted;
364184
}
365-
366-
@media only percy {
367-
#crate-downloads .graph {
368-
display: none;
369-
}
370-
}

0 commit comments

Comments
 (0)