Skip to content

Commit

Permalink
Restyling web interface
Browse files Browse the repository at this point in the history
  • Loading branch information
y6nH committed Aug 12, 2018
1 parent f29023b commit 107abe2
Show file tree
Hide file tree
Showing 17 changed files with 550 additions and 165 deletions.
2 changes: 1 addition & 1 deletion build.rs
Expand Up @@ -36,7 +36,7 @@ fn main() {
.unwrap();

Command::new("bundle")
.args(&["exec", "sass", "style/main.scss", "static/style.css"])
.args(&["exec", "sass", "style/style.scss", "static/style.css"])
.status()
.unwrap();
}
Expand Down
Binary file added static/img/icons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 135 additions & 37 deletions style/_base.scss
@@ -1,57 +1,116 @@
// it's 2018. please tell me that nobody is using box-sizing != border-box.
* { box-sizing: border-box; }
* {
box-sizing: border-box;
padding: 0;
margin: 0;
list-style-type: none;
font: inherit;
color: inherit;
background-color: inherit;
border: 0 currentcolor solid;
}

html {
font-size: 18px;
}

body {
// aesthetics
color: $text_color;
background-color: $background_color;

font-family: $base_font;
font-size: 1em;
line-height: $line_height;
font-feature-settings: "liga", "dlig", "hlig", "frac", "swsh", "onum", "pnum", "opbd";
}

// show focus outlines on everything!! tab accessibility~
:focus {
outline: $focused_color auto 1px;
}

a:active { color: $active_color; }
a {
color: $link_color;
&:hover {
color: $hover_color;
text-decoration: underline;
}
&:active {
color: $active_color;
}
&:visited {
color: $visited_color;
}
&[disabled] {
opacity: .5;
cursor: default;
}
}

code, pre {
code,
pre {
font-family: $mono_font;
color: inherit;
}

small {
font-size: .8em;
}

// restyle inputs so they look consistent across browsers
input {
input,
textarea {
color: $text_color;
background-color: white;
border: 1px solid $border_color;
background-color: $background_color;
border: $border_width solid $border_color;
padding: 1px 0px;

// fix for built-in browser styles
&:focus { outline-offset: 0; }
font-family: inherit; // fix for built-in browser styles
&:focus {
outline-offset: 0;
}
}

// restyle buttons so they look consistent across browsers
button {
font-family: inherit;
font-size: 1em;
color: $text_color;
background-color: $background_color;

border: 1px solid $border_color;
button,
a.button {
@extend %button-styling;
display: inline-block;
padding: 1px 6px;
padding: 1px 1rem;
text-align: center;
text-decoration: none;
cursor: pointer;
}

.write-status-controls {
padding: .5rem 0;
button {
min-width: 5rem;
}
}

.button--cancel {
float: left;
background: $border_color_alt;
&:hover {
background: $warning_color;
}
}

.button--post {
float: right;
background: $action_color;
color: $background_color;
&:hover {
background: $active_color;
}
}

form {
margin-top: 1em;
}

form.inline { display: inline; }
form.inline {
display: inline;
}

// space out form inputs a bit
form input {
Expand All @@ -63,36 +122,75 @@ form input {
button.link {
background: none;
border: none;
margin: 0; padding: 0;
color: blue;
margin: 0;
padding: 0;
color: $link_color;
cursor: pointer;
text-decoration: underline;
font-size: 1em;

&:active { color: $active_color; }
font-variant: normal;
box-shadow: none;
&:active {
color: $active_color;
}
&:hover {
color: $hover_color;
}
}

.flash {
border: 2px dashed $border_color;
padding: 1rem;

position: absolute;
top: 0;
left: 30%;
right: 30%;
text-align: center;
@extend %big-shadow;
&.error {
border-color: #900C3F;
background-color: #D29DB2;
border-color: $error_color;
background-color: $error_color_alt;
}

&.success {
border-color: #1D8348;
background-color: #58D68D;
border-color: $active_color;
background-color: $active_color_alt;
}
&-hider {
&,
&:checked~.flash,
&:checked~.flash-hider-label {
display: none;
}
&-label {
color: $error_color;
position: absolute;
top: 0;
right: 30%;
z-index: 5;
margin: .5em;
background: transparent;
}
}
}

textarea {
font: 1em $mono_font;
background-color: $background_color;
border: 1px solid $border_color;
}

.title {
text-transform: capitalize;
}
font-variant: small-caps;
font-size: 1.6rem;
margin-bottom: 1rem;
}

.status {
max-width: $column_width;
border-top: $standard_border;
padding: 1rem 0;
}

.timeline-avatar {
width: 3rem;
height: 3rem;
margin-right: 1rem;
border-radius: $border_radius;
float: left;
background: $visited_color;
}
25 changes: 5 additions & 20 deletions style/_collapsible.scss
@@ -1,27 +1,12 @@
@import 'defaults';

input[type="checkbox"].collapse--toggle {
display: none
display: none;
}

.collapse--lbl-toggle {
display: inline-block;
padding: 0.3rem;
border-radius: 0.3rem;

font-weight: bold;
font-family: $base_font;
font-variant: small-caps;
font-size: 1.1rem;


color: $background_color;
background-color: $action_color;

cursor: pointer;
user-select: none;

&:hover {
background-color: darken($action_color, 10%);
}
@extend %button-styling;
padding: 0 .5em;
}

.collapse--content {
Expand Down
61 changes: 61 additions & 0 deletions style/_defaults.scss
@@ -0,0 +1,61 @@
$text_color: hsl(200, 13%, 3%) !default;
$border_color_alt: hsl(200, 11%, 47%) !default;
$border_color: hsl(200, 22%, 78%) !default;
$background_color: hsl(42, 12%, 97%) !default;
$invert_color: hsl(0, 0, 100%) !default; // only for maximum contrast on mid-tone backgrounds
$action_color: hsl(120, 39%, 26%) !default;
$active_color: hsl(120, 65%, 42%) !default;
$active_color_alt: hsl(120, 64%, 70%) !default;
$link_color: hsl(200, 69%, 39%) !default;
$hover_color: hsl(200, 100%, 48%) !default;
$focused_color: hsl(200, 100%, 63%) !default;
$visited_color: hsl(272, 33%, 38%) !default;
$visited_color_alt: hsl(272, 47%, 73%) !default;
$error_color: hsl(358, 56%, 44%) !default;
$error_color_alt: hsl(358, 100%, 75%) !default;
$warning_color: hsl(42, 75%, 48%) !default;
$warning_color_alt: hsl(42, 100%, 73%) !default;

$shadow_color: hsla(42, 50%, 27%, 0.25) !default;

$base_font: 'Linux Libertine', FreeSerif, 'Gentium Plus', Georgia, 'Noto Serif', serif !default;
$mono_font: 'Noto Mono', 'Droid Sans Mono', Consolas, monospace !default;
$line_height: 1.4 !default;

$column_width: 24em;
$border_radius: 2px;
$border_width: 1px;
$standard_border: $border_width solid $border-color;


%big-shadow {
box-shadow: 0 3px 5px $shadow_color;
}

%small-shadow {
box-shadow: 0 1px 2px $shadow_color;
}

%inset-shadow {
box-shadow: inset 0 1px 2px $shadow_color;
}

%button-styling {
@extend %small-shadow;
display: inline-block;
padding: 0.3rem;
border: none;
border-radius: $border_radius;
font-weight: bold;
font-family: inherit;
font-variant: small-caps;
color: $invert_color;
background-color: $action_color;

cursor: pointer;
user-select: none;

&:hover {
background-color: $active_color;
}
}
41 changes: 32 additions & 9 deletions style/_layout.scss
@@ -1,28 +1,51 @@
@import 'defaults';

html {
// make html and body fill (at least) 100% of the height of the page.
height: 100%;
}

body {
// normalize
margin: 0;

// sticky footer via flexbox
display: flex;
flex-direction: column;
height: 100vh; // work around a silly ie11 issue
}

main {
// sticky footer via flexbox
flex: 1 0 auto;

padding: 1rem; // let the content breathe
padding: 2rem 0;
margin-top: 5rem;
display: flex;
border-bottom: $border_width solid $border_color; // set the footer off
@extend %big-shadow;
}

footer {
flex-shrink: 0; // prevent flexbox shrinkage (looking @ u, blink flexbox)
padding: 1rem 2rem;
margin: 1rem 0;
text-align: end;
}

main>section {
margin-bottom: 3rem;
padding: 0 2rem;
}

.write-status {
flex: 38%;
height: 6rem;
}

border-top: 1px solid $border_color; // set the footer off
padding: 1rem; // let the content breathe
.write-status-form {
max-width: $column_width;
input, textarea {
width: 100%;
}
}

.statuses {
clear: right;
flex: 62%;
}

0 comments on commit 107abe2

Please sign in to comment.