Skip to content

Commit e00532d

Browse files
authored
Use scss nesting & variables (#393)
* ued SCSS features * beatify scss * applied variables for fonts, borders, spacing * variables fr exra sizing * add variable for triagle * applied scss nesting * compiled scss to css
1 parent 9bd4907 commit e00532d

File tree

2 files changed

+128
-85
lines changed

2 files changed

+128
-85
lines changed

src/layout/css/style.scss

Lines changed: 106 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
1+
$font-size-text: 12px;
2+
$font-size-h1: 24px;
3+
$font-size-h2: 16px;
4+
5+
$border-width: 1px;
6+
7+
$spacing: 5px;
8+
9+
10+
111
body {
212
font-family: Helvetica, Arial, sans-serif;
3-
font-size: 12px;
13+
font-size: $font-size-text;
414
/* do not increase min-width as some may use split screens */
515
min-width: 800px;
616
color: #999;
717
}
818

919
h1 {
10-
font-size: 24px;
20+
font-size: $font-size-h1;
1121
color: black;
1222
}
1323

1424
h2 {
15-
font-size: 16px;
25+
font-size: $font-size-h2;
1626
color: black;
1727
}
1828

1929
p {
20-
color: black;
30+
color: black;
2131
}
2232

2333
a {
@@ -32,25 +42,40 @@ table {
3242
* SUMMARY INFORMATION
3343
******************************/
3444

35-
#environment td {
36-
padding: 5px;
37-
border: 1px solid #E6E6E6;
38-
}
45+
#environment {
46+
td {
47+
padding: $spacing;
48+
border: $border-width solid #E6E6E6;
49+
}
3950

40-
#environment tr:nth-child(odd) {
41-
background-color: #f6f6f6;
51+
tr:nth-child(odd) {
52+
background-color: #f6f6f6;
53+
}
4254
}
4355

4456
/******************************
4557
* TEST RESULT COLORS
4658
******************************/
47-
span.passed, .passed .col-result {
59+
span.passed,
60+
.passed .col-result {
4861
color: green;
4962
}
50-
span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
63+
64+
span.skipped,
65+
span.xfailed,
66+
span.rerun,
67+
.skipped .col-result,
68+
.xfailed .col-result,
69+
.rerun .col-result {
5170
color: orange;
5271
}
53-
span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
72+
73+
span.error,
74+
span.failed,
75+
span.xpassed,
76+
.error .col-result,
77+
.failed .col-result,
78+
.xpassed .col-result {
5479
color: red;
5580
}
5681

@@ -69,72 +94,85 @@ span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result,
6994
*------------------*/
7095

7196
#results-table {
72-
border: 1px solid #e6e6e6;
97+
border: $border-width solid #e6e6e6;
7398
color: #999;
74-
font-size: 12px;
75-
width: 100%
76-
}
99+
font-size: $font-size-text;
100+
width: 100%;
77101

78-
#results-table th, #results-table td {
79-
padding: 5px;
80-
border: 1px solid #E6E6E6;
81-
text-align: left
82-
}
83-
#results-table th {
84-
font-weight: bold
102+
th,
103+
td {
104+
padding: $spacing;
105+
border: $border-width solid #E6E6E6;
106+
text-align: left;
107+
}
108+
109+
th {
110+
font-weight: bold;
111+
}
85112
}
86113

87114
/*------------------
88115
* 2. Extra
89116
*------------------*/
90117

91-
.log:only-child {
92-
height: inherit
93-
}
118+
$extra-height: 240px;
119+
$extra-media-width: 320px;
120+
94121
.log {
95122
background-color: #e6e6e6;
96-
border: 1px solid #e6e6e6;
123+
border: $border-width solid #e6e6e6;
97124
color: black;
98125
display: block;
99126
font-family: "Courier New", Courier, monospace;
100-
height: 230px;
127+
height: $extra-height - 2 * $spacing;
101128
overflow-y: scroll;
102-
padding: 5px;
103-
white-space: pre-wrap
129+
padding: $spacing;
130+
white-space: pre-wrap;
131+
132+
&:only-child {
133+
height: inherit;
134+
}
104135
}
136+
105137
div.image {
106-
border: 1px solid #e6e6e6;
138+
border: $border-width solid #e6e6e6;
107139
float: right;
108-
height: 240px;
109-
margin-left: 5px;
140+
height: $extra-height;
141+
margin-left: $spacing;
110142
overflow: hidden;
111-
width: 320px
112-
}
113-
div.image img {
114-
width: 320px
143+
width: $extra-media-width;
144+
145+
img {
146+
width: $extra-media-width;
147+
}
115148
}
149+
116150
div.video {
117-
border: 1px solid #e6e6e6;
151+
border: $border-width solid #e6e6e6;
118152
float: right;
119-
height: 240px;
120-
margin-left: 5px;
121-
overflow: hidden;
122-
width: 320px
123-
}
124-
div.video video {
153+
height: $extra-height;
154+
margin-left: $spacing;
125155
overflow: hidden;
126-
width: 320px;
127-
height: 240px;
156+
width: $extra-media-width;
157+
158+
video {
159+
overflow: hidden;
160+
width: $extra-media-width;
161+
height: $extra-height;
162+
}
128163
}
164+
129165
.collapsed {
130166
display: none;
131167
}
168+
132169
.expander::after {
133170
content: " (show details)";
134171
color: #BBB;
135172
font-style: italic;
136173
cursor: pointer;
137174
}
175+
138176
.collapser::after {
139177
content: " (hide details)";
140178
color: #BBB;
@@ -152,26 +190,28 @@ div.video video {
152190
.sort-icon {
153191
font-size: 0px;
154192
float: left;
155-
margin-right: 5px;
156-
margin-top: 5px;
193+
margin-right: $spacing;
194+
margin-top: $spacing;
195+
157196
/*triangle*/
197+
$triangle-width: 8px;
158198
width: 0;
159199
height: 0;
160-
border-left: 8px solid transparent;
161-
border-right: 8px solid transparent;
162-
}
163-
164-
.inactive .sort-icon {
165-
/*finish triangle*/
166-
border-top: 8px solid #E6E6E6;
167-
}
168-
169-
.asc.active .sort-icon {
170-
/*finish triangle*/
171-
border-bottom: 8px solid #999;
172-
}
173-
174-
.desc.active .sort-icon {
175-
/*finish triangle*/
176-
border-top: 8px solid #999;
200+
border-left: $triangle-width solid transparent;
201+
border-right: $triangle-width solid transparent;
202+
203+
.inactive {
204+
/*finish triangle*/
205+
border-top: $triangle-width solid #E6E6E6;
206+
}
207+
208+
.asc.active {
209+
/*finish triangle*/
210+
border-bottom: $triangle-width solid #999;
211+
}
212+
213+
.desc.active {
214+
/*finish triangle*/
215+
border-top: $triangle-width solid #999;
216+
}
177217
}

src/pytest_html/resources/style.css

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)