tidy up, add base responsive nav, update readme

This commit is contained in:
Lukas Juhas 2017-08-25 17:11:48 +01:00
parent f459a49dd3
commit 0d1c5d3e1e
21 changed files with 429 additions and 305 deletions

View file

@ -1,54 +1,51 @@
body {
color: $base-colour;
font-family: $base-font-family;
@include font-size($base-font-size);
line-height: $base-line-height;
-webkit-text-size-adjust: none;
color: $base-colour;
font-family: $base-font-family;
line-height: $base-line-height;
text-size-adjust: none;
@include font-size($base-font-size);
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
hr,
ul,
h1,
h2,
h3,
h4,
h5,
h6,
p,
hr,
ul,
ol,
dl,
address {
margin-bottom: $base-spacing-unit;
margin-bottom: $base-spacing-unit;
}
/**
* Basic styles for links
*/
a {
color: $brand-colour;
text-decoration: none;
&:hover {
color: $base-colour;
text-decoration: underline;
}
color: $brand-colour;
text-decoration: none;
&:hover {
color: $base-colour;
text-decoration: underline;
}
}
a[href^="tel"]{
color: inherit;
text-decoration: none;
font-family: inherit;
font-size: inherit;
font-style: inherit;
a[href^="tel"] {
font-size: inherit;
font-family: inherit;
color: inherit;
text-decoration: none;
font-style: inherit;
}
/**
* Rulers
* Rules
*/
hr {
background-color: $base-colour;
height: 1px;
}
height: 1px;
background-color: $base-colour;
}

View file

@ -1,3 +1,3 @@
/**
* This file contains all @font-face declarations, if any.
*/
*/

View file

@ -1,122 +1,126 @@
/**
* Blanket input styles for normalisation
*/
*:focus {
outline: 0;
outline: 0;
}
input,
select,
input,
select,
textarea {
background-color: $base-background-colour;
border: solid 1px $base-colour;
border-radius: 0;
color: $base-colour;
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
padding: 0 ($base-spacing-unit / 2);
width: 100%;
background-color: $base-background-colour;
border: solid 1px $base-colour;
border-radius: 0;
color: $base-colour;
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
padding: 0 ($base-spacing-unit / 2);
width: 100%;
}
input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
background: transparent;
border: 0;
line-height: normal;
height: auto;
width: auto;
background: transparent;
border: 0;
line-height: normal;
height: auto;
width: auto;
}
input[type="file"] {
line-height: normal;
height: auto;
padding: ($base-spacing-unit / 4) ($base-spacing-unit / 2);
line-height: normal;
height: auto;
padding: ($base-spacing-unit / 4) ($base-spacing-unit / 2);
}
input[type="submit"] {
-webkit-border-radius: 0;
border-radius: 0;
border-radius: 0;
}
input[disabled] {
background-color: whitesmoke;
cursor: not-allowed;
background-color: whitesmoke;
cursor: not-allowed;
}
select {
line-height: normal;
padding: 0;
padding-left: ($base-spacing-unit / 2);
line-height: normal;
padding: 0;
padding-left: ($base-spacing-unit / 2);
}
textarea {
min-height: ($base-spacing-unit * 4);
overflow: auto;
vertical-align: top;
resize: vertical;
min-height: ($base-spacing-unit * 4);
overflow: auto;
vertical-align: top;
resize: vertical;
}
/**
* Form utility classes
*/
.form--inline {
.form__group {
display: inline-block;
}
.form__group {
display: inline-block;
}
}
.checkbox,
.radio {
display: block;
padding-left: $base-spacing-unit;
&.inline {
display: inline-block;
}
> input {
float: left;
margin-left: -($base-spacing-unit);
margin-top: 4px;
}
display: block;
padding-left: $base-spacing-unit;
&.inline {
display: inline-block;
}
> input {
float: left;
margin-left: -($base-spacing-unit);
margin-top: 4px;
}
}
.form__group {
display: block;
margin-bottom: $base-spacing-unit;
display: block;
margin-bottom: $base-spacing-unit;
}
.form__label {
display: block;
margin-bottom: ($base-spacing-unit / 2);
display: block;
margin-bottom: ($base-spacing-unit / 2);
}
/**
* Input Group
*
* Allows for prepend/append of elements
* Allows for prepend/append of elements
* (such as icons) on an input.
*/
.input-group {
position: relative;
> input {
padding: 0 ($base-spacing-unit * 2);
position: relative;
> input {
padding: 0 ($base-spacing-unit * 2);
}
.input-group__addon {
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
position: absolute;
text-align: center;
top: 0;
width: ($base-spacing-unit * 1.5);
&:first-child {
left: 0;
}
.input-group__addon {
line-height: ($base-spacing-unit * 1.5);
height: ($base-spacing-unit * 1.5);
position: absolute;
text-align: center;
top: 0;
width: ($base-spacing-unit * 1.5);
&:first-child {
left: 0;
}
&:last-child {
right: 0;
}
&:last-child {
right: 0;
}
}
}

View file

@ -1,16 +1,14 @@
img {
max-width: 100%;
height: auto;
vertical-align: top;
max-width: 100%;
height: auto;
vertical-align: top;
}
/**
* Responsive images
*/
.is-fluid {
display: block;
width: 100%;
height: auto;
display: block;
width: 100%;
height: auto;
}

View file

@ -1,16 +1,16 @@
ul,
ul,
ol {
margin-left: $base-spacing-unit;
margin-left: $base-spacing-unit;
}
li {
> ul,
> ol {
margin-bottom: 0;
}
> ul,
> ol {
margin-bottom: 0;
}
}
.list--unstyled {
list-style: none;
margin-left: 0;
}
margin-left: 0;
list-style: none;
}

View file

@ -1,12 +1,12 @@
h1,
h2,
h3,
h4,
h5,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: bold;
}
small {
font-size: .75em;
}
font-size: .75em;
}

View file

@ -1,28 +1,34 @@
.alert {
padding: $base-spacing-unit;
margin-bottom: $base-spacing-unit;
border: 1px solid transparent;
> p,
> ul {
margin-bottom: 0;
}
> p + p {
margin-top: $base-spacing-unit;
}
&.alert--success {
color: $success-colour;
border-color: $success-colour;
}
&.alert--info {
color: $info-colour;
border-color: $info-colour;
}
&.alert--warning {
color: $warning-colour;
border-color: $warning-colour;
}
&.alert--danger {
color: $danger-colour;
border-color: $danger-colour;
}
padding: $base-spacing-unit;
margin-bottom: $base-spacing-unit;
border: 1px solid transparent;
> p,
> ul {
margin-bottom: 0;
}
> p + p {
margin-top: $base-spacing-unit;
}
&.alert--success {
color: $success-colour;
border-color: $success-colour;
}
&.alert--info {
color: $info-colour;
border-color: $info-colour;
}
&.alert--warning {
color: $warning-colour;
border-color: $warning-colour;
}
&.alert--danger {
color: $danger-colour;
border-color: $danger-colour;
}
}

View file

@ -1,54 +1,59 @@
.btn {
background-color: $brand-colour;
color: $base-background-colour;
border: 1px solid transparent;
display: inline-block;
padding: ($base-spacing-unit / 4) $base-spacing-unit;
text-align: center;
white-space: nowrap;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
user-select: none;
width: auto;
transition: all .5s;
&::-moz-focus-inner {
border: 0;
padding: 0;
}
&:hover {
text-decoration: none;
background-color: $base-background-colour;
color: $brand-colour;
border: 1px solid $brand-colour;
}
.is-disabled,
&:disabled {
pointer-events: none;
opacity: .65;
}
}
background-color: $brand-colour;
color: $base-background-colour;
border: 1px solid transparent;
display: inline-block;
padding: ($base-spacing-unit / 4) $base-spacing-unit;
text-align: center;
white-space: nowrap;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
user-select: none;
width: auto;
transition: all .5s;
.btn--inverse {
&::-moz-focus-inner {
border: 0;
padding: 0;
}
&:hover {
text-decoration: none;
background-color: $base-background-colour;
color: $brand-colour;
border: 1px solid $brand-colour;
&:hover {
background-color: $brand-colour;
color: $base-background-colour;
border: 1px solid transparent;
}
}
.is-disabled,
&:disabled {
pointer-events: none;
opacity: .65;
}
}
.btn--inverse {
background-color: $base-background-colour;
color: $brand-colour;
border: 1px solid $brand-colour;
&:hover {
background-color: $brand-colour;
color: $base-background-colour;
border: 1px solid transparent;
}
}
.btn--block {
display: block;
width: 100%;
+ .btn--block {
margin-top: $base-spacing-unit / 4;
}
display: block;
width: 100%;
+ .btn--block {
margin-top: $base-spacing-unit / 4;
}
}
.btn--link {
background-color: transparent;
color: $brand-colour;
}
background-color: transparent;
color: $brand-colour;
}

View file

@ -1,14 +1,102 @@
.nav {
list-style: none;
margin: 0;
> li {
display: inline-block;
margin-right: $base-spacing-unit;
&:last-child {
margin-right: 0;
}
> a {
display: block;
}
// hamburger menu
.nav-burger {
position: fixed;
top: $base-spacing-unit;
right: $base-spacing-unit;
z-index: 550;
transition: all $animation-speed $animation;
}
.nav-burger__line {
width: 35px;
height: 3px;
background-color: $brand-colour;
display: none;
margin: 8px auto;
transition: all $animation-speed $animation;
@include resp-max($breakpoint-md) {
display: block;
}
.nav-burger.open & {
&:nth-child(2) {
opacity: 0;
}
}
&:nth-child(1) {
transform: translateY(11px) rotate(45deg);
}
&:nth-child(3) {
transform: translateY(-11px) rotate(-45deg);
}
}
}
// applies to all navs
.nav {
list-style: none;
margin: 0;
> li {
display: inline-block;
margin-right: $base-spacing-unit;
&:last-child {
margin-right: 0;
}
> a {
display: block;
}
}
}
.nav--header {
// header nav styling goes here
// mobile nav
@include resp-max($breakpoint-md) {
position: fixed;
top: 0;
left: 0;
visibility: hidden;
width: 0;
height: 100%;
margin: 0;
transition: opacity 500ms ease;
transition: opacity .35s ease, visibility .35s ease, width .35s ease;
text-align: center;
opacity: 0;
background: $base-background-colour;
-webkit-overflow-scrolling: touch;
&.open {
z-index: 500;
visibility: visible;
width: 100%;
opacity: 1;
ul {
position: absolute;
top: 50%;
left: 0;
overflow: auto;
width: 100%;
max-height: 100%;
margin: 0;
padding: 0;
user-select: none;
transform: translateY(-50%);
-webkit-touch-callout: none;
-webkit-overflow-scrolling: touch;
> li {
width: 100%;
margin: 0;
}
}
}
}
}

View file

@ -1,60 +1,56 @@
/*
* Media query to respond to a minimum size (mobile first)
*/
@mixin resp-min($size) {
@media screen and (min-width: $size) {
@content;
}
@media screen and (min-width: $size) {
@content;
}
}
/*
* Media query to respond to a maximum size
*/
@mixin resp-max($size) {
@media screen and (max-width: $size) {
@content;
}
@media screen and (max-width: $size) {
@content;
}
}
/*
* Output font size in px/rem
*/
@mixin font-size($px) {
font-size: $px + px;
font-size: #{$px / 16}rem;
font-size: $px + px;
font-size: #{$px / 16}rem;
}
/*
* Placeholder mixin for <input>
*/
@mixin placeholder {
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@each $placeholder in $placeholders {
&:#{$placeholder}-placeholder {
@content;
}
}
}
/**
* Clearfix
*/
@mixin clearfix {
&:before,
&:after{
content: " ";
display: table;
}
&:after{
clear: both;
}
&:before,
&:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}

View file

@ -55,3 +55,9 @@ $grid-gutter: $base-spacing-unit;
*/
$border-radius: 3px;
/**
* Animations
*/
$animation-speed: 250ms;
$animation: ease-in-out;

View file

@ -0,0 +1,5 @@
.logo {
width: 200px;
height: auto;
display: inline-block;
}

View file

@ -1,81 +1,84 @@
/**
* Clearing and floating
*/
* Clearing and floating
*/
.alignleft,
.float-left {
float: left;
img & {
margin-right: $base-spacing-unit;
}
float: left;
img & {
margin-right: $base-spacing-unit;
}
}
.alignright,
.float-right {
float: right;
img & {
margin-left : $base-spacing-unit;
}
float: right;
img & {
margin-left : $base-spacing-unit;
}
}
.aligncenter,
.float-center {
display: block;
margin: {
left: auto;
right: auto;
}
img & {
margin-bottom: $base-spacing-unit;
}
display: block;
margin: {
left: auto;
right: auto;
}
img & {
margin-bottom: $base-spacing-unit;
}
}
.clearfix {
@include clearfix();
@include clearfix();
}
/**
* Text aligments
*/
* Text aligments
*/
.align-text-left {
text-align: left;
text-align: left;
}
.align-text-right {
text-align: right;
text-align: right;
}
.align-text-center {
text-align: center;
text-align: center;
}
/**
* Elements visibility
*/
* Elements visibility
*/
.visible-on-mobile {
display: none !important;
@include resp-max($breakpoint-sm) {
display: block !important;
}
display: none !important;
@include resp-max($breakpoint-sm) {
display: block !important;
}
}
.visible-on-tablet {
display: none !important;
@include resp-max($breakpoint-md) {
display: block !important;
}
@include resp-max($breakpoint-sm) {
display: none !important;
@include resp-max($breakpoint-md) {
display: block !important;
}
@include resp-max($breakpoint-sm) {
display: none !important;
}
}
}
.visible-on-desktop {
@include resp-max($breakpoint-md) {
display: none !important;
}
@include resp-max($breakpoint-md) {
display: none !important;
}
}

View file

@ -17,12 +17,13 @@ html {
text-rendering: optimizeLegibility;
}
input,
select,
input,
select,
textarea,
button {
color: inherit;
display: inline-block;
&[disabled] {
cursor: not-allowed;
}
@ -35,8 +36,9 @@ button {
table {
border-collapse: collapse;
border-spacing: 0;
th,
td {
text-align: left;
}
}
}

View file

@ -1,18 +1,16 @@
@each $breakpoint in $breakpoints {
$key : nth($breakpoint, 1);
$value : nth($breakpoint, 2);
$key : nth($breakpoint, 1);
$value : nth($breakpoint, 2);
.visible-#{$key} {
@media only screen and #{$value} {
display: block !important;
}
.visible-#{$key} {
@media only screen and #{$value} {
display: block !important;
}
}
.hidden-#{$key} {
@media only screen and #{$value} {
display: none !important;
}
.hidden-#{$key} {
@media only screen and #{$value} {
display: none !important;
}
}
}
}