[!!!][TASK] Refactor Scss, add Sass-lint and adjust styling

Add variables to allow easy modifications to color, font and also extending Style
This commit is contained in:
Xaver Maierhofer 2016-05-27 01:34:42 +02:00 committed by Milan Pässler
commit ed06ff6b09
50 changed files with 762 additions and 888 deletions

56
scss/modules/_base.scss Normal file
View file

@ -0,0 +1,56 @@
body {
background: $color-white;
color: $color-black;
font-family: $font-family;
font-size: $font-size;
overflow-y: scroll;
}
header {
background: rgba($color-black, .02);
}
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
h1 {
font-size: 2em;
padding: .67em 0;
}
h2 {
font-size: 1.5em;
padding: .83em 0;
}
h3 {
font-size: 1.17em;
padding: 1em 0;
}
h2, h3 {
padding-left: $buttondistance;
padding-right: $buttondistance;
}
p, pre, ul, h4 {
padding: 0 $buttondistance 1em;
}
img {
max-width: 100%;
}
a {
color: $color-online;
text-decoration: none;
}
p {
line-height: 1.67em;
}
strong {
font-weight: bold;
}

47
scss/modules/_button.scss Normal file
View file

@ -0,0 +1,47 @@
button {
background: $color-white;
border: 0;
border-radius: .9em;
color: $color-black;
cursor: pointer;
font-family: $font-family-icons;
font-size: 20pt;
height: 1.8em;
opacity: .7;
outline: none;
transition: box-shadow .5s, color .5s;
width: 1.8em;
&.active {
color: $color-primary;
}
&:hover {
background: $color-white;
color: $color-primary;
}
&.shadow {
@include shadow(1);
&:hover {
@include shadow(2);
}
&:active {
box-shadow: inset 0 5px 20px rgba($color-black, .19), inset 0 3px 6px rgba($color-black, .23);
}
}
&.close {
background: none;
border-radius: 0;
box-shadow: none;
color: rgba($color-black, .5);
float: right;
font-size: 20pt;
height: auto;
margin: $buttondistance;
width: auto;
}
}

40
scss/modules/_filter.scss Normal file
View file

@ -0,0 +1,40 @@
.filters {
display: flex;
flex-wrap: wrap;
font-size: .83em;
padding: 0 6pt 6pt;
li {
align-items: center;
background: transparent;
border: 1px solid $color-primary;
color: $color-primary;
display: flex;
margin: 3pt;
padding: 0 0 0 8pt;
label {
cursor: pointer;
}
button {
background: none;
color: $color-gray-light;
font-size: 12pt;
height: 18pt;
margin: 2pt;
width: 18pt;
&:hover {
color: $color-primary;
}
}
&.not {
label {
color: $color-primary;
text-decoration: line-through;
}
}
}
}

View file

@ -0,0 +1,10 @@
.graph {
background: $color-gray-dark;
height: 100%;
width: 100%;
canvas {
display: block;
position: absolute;
}
}

View file

@ -0,0 +1,27 @@
.infobox {
.clients {
color: $color-online;
font-family: $font-family-icons;
}
input, textarea {
border: 1px solid $color-gray-light;
font-family: $font-family-monospace;
font-size: 1.15em;
line-height: 1.67em;
margin-right: .7em;
max-width: 500px;
min-height: 42px;
padding: 3px 6px;
vertical-align: bottom;
width: calc(100% - 80px);
}
textarea {
font-size: .8em;
height: 100px;
max-height: 300px;
overflow: auto;
resize: vertical;
}
}

View file

@ -0,0 +1,34 @@
.leaflet-control-layers {
background: none;
border-radius: 0;
box-shadow: none;
}
.leaflet-control-layers-toggle {
background: none;
&::before {
color: $color-primary;
content: '\f229';
display: inline-block;
font-family: $font-family-icons;
font-size: 2.3rem;
line-height: 1;
speak: none;
text-rendering: auto;
}
}
.leaflet-control-layers-expanded {
padding: 0;
}
.leaflet-control-layers-list {
background: rgba($color-white, .9);
color: $color-gray-dark;
padding: 10px;
label {
cursor: pointer;
}
}

32
scss/modules/_legend.scss Normal file
View file

@ -0,0 +1,32 @@
.legend {
.symbol {
border-radius: 50%;
display: inline-block;
height: 1em;
vertical-align: -5%;
width: 1em;
}
}
// Dot looks compared to thin font a bit darker - lighten it 10%
.legend-new {
.symbol {
background-color: lighten($color-new, 10%);
}
}
.legend-online {
.symbol {
background-color: lighten($color-online, 10%);
}
}
.legend-offline {
.symbol {
background-color: lighten($color-offline, 10%);
}
}
.legend-online, .legend-offline {
margin-left: 1em;
}

41
scss/modules/_map.scss Normal file
View file

@ -0,0 +1,41 @@
.content {
height: 100vh;
position: fixed;
width: 100%;
.buttons {
direction: rtl;
position: absolute;
right: $buttondistance;
top: $buttondistance;
unicode-bidi: bidi-override;
z-index: 100;
button {
margin-left: $buttondistance;
}
@media screen and (max-width: $minscreenwidth) {
right: 0;
transform: scale(.8);
}
}
@media screen and (max-width: $minscreenwidth) {
height: 60vh;
position: relative;
width: auto;
}
}
.stroke-first {
paint-order: stroke;
}
.pick-coordinates {
cursor: crosshair;
}
.map {
height: 100%;
width: 100%;
}

21
scss/modules/_node.scss Normal file
View file

@ -0,0 +1,21 @@
.bar {
background: rgba($color-new, .5);
display: block;
height: 1.4em;
position: relative;
span {
background: rgba($color-new, .8);
display: inline-block;
height: 1.4em;
}
label {
color: $color-white;
font-weight: bold;
position: absolute;
right: .5em;
top: .1em;
white-space: nowrap;
}
}

View file

@ -0,0 +1,20 @@
.proportion {
th {
font-size: .95em;
font-weight: normal;
padding-right: .71em;
text-align: right;
}
td {
text-align: left;
}
span {
box-sizing: border-box;
display: inline-block;
font-weight: bold;
min-width: 1.5em;
padding: .25em .5em;
}
}

39
scss/modules/_reset.scss Normal file
View file

@ -0,0 +1,39 @@
// Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
// http://cssreset.com
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
padding: 0;
vertical-align: baseline;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

127
scss/modules/_sidebar.scss Normal file
View file

@ -0,0 +1,127 @@
.sidebar {
box-sizing: border-box;
position: absolute;
transition: left .5s;
width: $sidebarwidth;
z-index: 5;
&.hidden {
left: -$sidebarwidth - $buttondistance;
.sidebarhandle {
left: $buttondistance;
transform: scale(-1, 1);
}
@media screen and (max-width: $minscreenwidth) {
width: auto;
}
}
.node-list, .node-links {
th, td {
&:first-child {
width: 25px;
}
&:nth-child(2) {
overflow: hidden;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
width: 50%;
}
}
}
.node-links {
th, td {
&:first-child {
width: 50px;
}
}
}
.link-list {
th, td {
&:nth-child(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 66%;
}
}
}
.infobox, .container {
@include shadow(2);
background: rgba($color-white, .97);
min-height: 100vh;
overflow-y: visible;
}
.container {
&.hidden {
display: none;
}
}
@media screen and (max-width: 80em) {
@include shadow(2);
background: $color-white;
font-size: .8em;
margin: 0;
width: $sidebarwidthsmall;
.sidebarhandle {
left: $sidebarwidthsmall + $buttondistance;
}
.container, .infobox {
border-radius: 0;
box-shadow: none;
margin: 0;
}
}
@media screen and (max-width: $minscreenwidth) {
height: auto;
min-height: 0;
position: static;
width: auto;
.sidebarhandle {
display: none;
}
.content {
height: 60vh;
position: relative;
width: auto;
}
}
}
.sidebarhandle {
left: $sidebarwidth + 2 * $buttondistance;
position: fixed;
top: $buttondistance;
transition: left .5s, box-shadow .5s, color .5s, transform .5s;
z-index: 10;
&::after {
content: '\f124';
padding-right: .125em;
}
}
.online {
color: $color-new;
}
.offline {
color: $color-offline;
}
.unseen {
color: #d89100;
}

76
scss/modules/_table.scss Normal file
View file

@ -0,0 +1,76 @@
table {
border-collapse: separate;
border-spacing: 0 .5em;
padding: 0 $buttondistance;
width: 100%;
&.attributes {
line-height: 1.41em;
th {
font-weight: bold;
padding-right: 1em;
text-align: left;
vertical-align: top;
white-space: nowrap;
}
td {
text-align: left;
width: 100%;
}
}
}
td, th {
line-height: 1.41em;
text-align: right;
&:first-child {
text-align: left;
}
}
th {
font-weight: bold;
&.sort-header {
cursor: pointer;
&::selection {
background: transparent;
}
&::after {
content: '\f10d';
font-family: $font-family-icons;
padding-left: .25em;
visibility: hidden;
}
&:hover {
&::after {
visibility: visible;
}
}
}
&.sort-up {
&::after {
content: '\f104';
}
}
&.sort-up, &.sort-down {
&:after {
opacity: .4;
visibility: visible;
}
}
}
.tab {
table {
table-layout: fixed;
}
}

27
scss/modules/_tabs.scss Normal file
View file

@ -0,0 +1,27 @@
.tabs {
@include shadow(1);
background: rgba($color-black, .02);
display: flex;
font-family: $font-family;
list-style: none;
margin: 0;
padding: 1em 0 0;
li {
color: rgba($color-black, .5);
cursor: pointer;
flex: 1 1 auto;
padding: .5em .5em 1em;
text-align: center;
text-transform: uppercase;
&:hover {
color: $color-black;
}
}
.visible {
border-bottom: 2pt solid $color-primary;
color: $color-primary;
}
}

View file

@ -0,0 +1,22 @@
$color-white: #fff !default;
$color-black: #000 !default;
$color-gray-light: darken($color-white, 30%) !default;
$color-gray-dark: lighten($color-black, 20%) !default;
$color-primary: #dc0067 !default;
$color-new: #459c18 !default;
$color-online: #1566a9 !default;
$color-offline: #cf3e2a !default;
$font-family: 'Roboto Slab', serif !default;
$font-family-secondary: Roboto, sans-serif !default;
$font-family-icons: ionicons !default;
$font-family-monospace: monospace !default;
$font-size: 11pt !default;
$minscreenwidth: 630pt !default;
$sidebarwidth: 420pt !default;
$sidebarwidthsmall: 320pt !default;
$buttondistance: 12pt !default;

1
scss/modules/icon.scss Symbolic link
View file

@ -0,0 +1 @@
../../assets/icons/icon.scss