Skip to content

Commit

Permalink
[Test] Publishing test for atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Isaksen committed Jul 28, 2016
1 parent 5d5adc2 commit aa09a4b
Show file tree
Hide file tree
Showing 71 changed files with 943 additions and 240 deletions.
Binary file added assets/fonts/icomoon.eot
Binary file not shown.
Binary file added assets/fonts/icomoon.woff
Binary file not shown.
1 change: 1 addition & 0 deletions atomic/_particles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "util";
@import "particles/props";
@import "particles/modifiers";
@import "particles/mixins";
70 changes: 70 additions & 0 deletions atomic/_util.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@import "../props";

@mixin custom_property($prop, $val, $fallback: true) {
// Modified from
// http://codepen.io/jakealbaugh/post/css4-variables-with-fallbacks-using-sass
$map__name: map-get($prop__map, $prop);
$nest__name: null;
$nest__map__name: null;
$map: null;
$var__fall: null;
$var__output: null;

@if type-of($map__name) == list {
$nest__name: nth($map__name, 1);
$nest__map__name: nth($map__name, 2);
}

@if $nest-name {
$map: map-get($prop__map, $nest__name);
$nest__map: map-get($map, $nest__map__name);
$var__fall: map-get($nest__map, $val);
$var-output: var(--#{$nest__name}-#{$nest__map__name}-#{$val});
} @else {
$map: map-get($prop__map, $map-name);
$var-fall: map-get($map, $var);
$var-output: var(--#{$map__name}-#{$val});
}
@if $fallback {
#{$prop}: $val;
}
#{$prop}: $var__output;

}

@mixin apply-directive($name, $fallback: true){
@if $name {
@if $fallback {
@extend %#{$name};
}
@apply #{--$name}
}
}

@mixin custom_properties($var__map){
@each $prop__name, $prop__mapping in $prop__map {

@each $var, $val in $prop__mapping {
@if type-of($val) == map {
@each $var__n, $val__n in $val {
#{--$prop__name}__#{$var}__#{$var__n}: $val__n;
}
} @else {
#{--$prop__name}__#{$var}: $val;
}
}
}
}

@mixin divide_children($box-spacing) {

> *:after {
content: "|";
margin: 0 $box-spacing;
}

> *:last-child:after {
content: none;
}

}
4 changes: 4 additions & 0 deletions atomic/atoms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "atoms/directives";
@import "atoms/custom_properties";
@import "atoms/reset";
@import "atoms/elements";
5 changes: 5 additions & 0 deletions atomic/atoms/custom_properties.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "../particles";

:root {
@include custom_properties($prop__map);
}
4 changes: 4 additions & 0 deletions atomic/atoms/directives.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "directives/font-face/primary";
@import "directives/font-face/secondary";
@import "directives/font-face/icon";
@import "directives/keyframes";
Empty file.
15 changes: 15 additions & 0 deletions atomic/atoms/directives/font-face/primary.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import "particles/mixins/type";
@import "particles/props/type";

$font_faces: map-get($type, map-get(font, primary));

@each $font in $font_faces {

@font-face {
font-family: '#{$font}';
@include type-src($font);
font-weight: normal;
font-style: normal;
}

}
15 changes: 15 additions & 0 deletions atomic/atoms/directives/font-face/secondary.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import "particles/mixins/type";
@import "particles/props/type";

$font_faces: map-get($type, map-get(font, secondary));

@each $font in $font_faces {

@font-face {
font-family: '#{$font}';
@include type-src($font);
font-weight: normal;
font-style: normal;
}

}
Empty file.
13 changes: 13 additions & 0 deletions atomic/atoms/elements.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import "elements/body";
@import "elements/lists";
@import "elements/anchor";
@import "elements/em";
@import "elements/headlines";
@import "elements/hr";
@import "elements/inputs";
@import "elements/lists";
@import "elements/media";
@import "elements/small";
@import "elements/strong";
@import "elements/table";
@import "elements/template";
16 changes: 16 additions & 0 deletions atomic/atoms/elements/anchor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import "../../particles/props/color";

a,
[role=link] {

background-color: $color-white--alpha;
-webkit-text-decoration-skip: objects;
text-decoration: none;
font-size: inherit;

&:active,
&:hover {
outline-width: 0;
text-decoration: underline;
}
}
11 changes: 11 additions & 0 deletions atomic/atoms/elements/body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

@import "../../particles/mixins/type";
@import "../../particles/props/color";
@import "../config";

body {
margin: 0;
padding: 0;
color: map-get($color, gray--dark);
@include type-baseline(map-get($type, map-get(font, body)));
}
31 changes: 31 additions & 0 deletions atomic/atoms/elements/headlines.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@import "../../particles/props/type";
@import "../../particles/props/color";

h1, h2, h3, h4, h5, h6 {
font-weight: map-get($type, weight--heavy);
color: map-get($color, gray--darker);
}

// h1 {
// font-size: $type-size--h1;
// }
//
// h2 {
// font-size: $type-size--h2;
// }
//
// h3 {
// font-size: $type-size--h3;
// }
//
// h4 {
// font-size: $type-size--h4;
// }
//
// h5 {
// font-size: $type-size--h5;
// }
//
// h6 {
// font-size: $type-size--h6;
// }
5 changes: 5 additions & 0 deletions atomic/atoms/elements/hr.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
11 changes: 11 additions & 0 deletions atomic/atoms/elements/inputs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import "inputs/button";
@import "inputs/checkbox";
@import "inputs/fieldset";
@import "inputs/file";
@import "inputs/label";
@import "inputs/legend";
@import "inputs/number";
@import "inputs/optgroup";
@import "inputs/radio";
@import "inputs/search";
@import "inputs/textarea";
39 changes: 39 additions & 0 deletions atomic/atoms/elements/inputs/button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import '../../particles/mixins/box';
@import '../../particles/props/type';
@import '../../particles/props/color';

button,
[role=button],
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
appearance: button;
cursor: pointer;
display: block;
width: 100%;
font-size: map-get($type, size--baseline);
line-height: map-get($type, map-get(leading, icon));
margin: 0;
@include box__border__radius;
padding: map-get($box-spacing, spacing--wide);
text-align: center;

@include form__button;
@include form__button--disabled;

&::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}

&:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
}
19 changes: 19 additions & 0 deletions atomic/atoms/elements/inputs/checkbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import "../../particles/props/color";
@import "../../particles/props/box";
@import "../../particles/mixins/box";
@import "../../particles/props/icon";

input[type=checkbox],
[role=checkbox] {

padding: 0;
margin: map-get($box, space--thinner);
text-align: center;
@include box__border;

&:checked {map-get(
content: map-get($)icon, input--checkbox);
color: map-get($color, action--success);
}

}
8 changes: 8 additions & 0 deletions atomic/atoms/elements/inputs/fieldset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import "../../particles/props/box";
@import "../../particles/mixins/box";

fieldset {
@include box__border;
margin: 0 map-get($box, spacing--thinner);
padding: 0.35em 0.625em 0.75em;
}
8 changes: 8 additions & 0 deletions atomic/atoms/elements/inputs/file.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
input[type=file] {

::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}

}
8 changes: 8 additions & 0 deletions atomic/atoms/elements/inputs/label.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import "../../particles/props/type";
@import "../../particles/props/box";

label {
display: inline-block;
font-size: map-get($type, size--baseline);
margin-right: map-get($box, space);
}
8 changes: 8 additions & 0 deletions atomic/atoms/elements/inputs/legend.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
legend {
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
8 changes: 8 additions & 0 deletions atomic/atoms/elements/inputs/number.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
input[type="number"] {

&::-webkit-inner-spin-button,
&::-webkit-outer-spin-button {
height: auto;
}

}
3 changes: 3 additions & 0 deletions atomic/atoms/elements/inputs/optgroup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
optgroup {
font-weight: bold;
}
24 changes: 24 additions & 0 deletions atomic/atoms/elements/inputs/radio.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
input[type=radio],
[role=radio] {

border-radius: 50%;
cursor: pointer;
display: flex;
min-width: 1.5em;
min-height: 1.5em;
margin: 0 1em 0 0;
justify-content: center;
align-items: center;

&:checked::after {
display: block;
background-color: #3777bc;
border-radius: 50%;
content: "";
position: relative;
left: .025em;
min-width: .75em;
min-height: .75em;
}

}
12 changes: 12 additions & 0 deletions atomic/atoms/elements/inputs/search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
input[type=search],
[role=search] {

-webkit-appearance: textfield;
outline-offset: -2px;

&::-webkit-search-cancel-button,
&::-webkit-search-decoration {
-webkit-appearance: none;
}

}
3 changes: 3 additions & 0 deletions atomic/atoms/elements/inputs/textarea.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
textarea {
overflow: auto;
}
2 changes: 2 additions & 0 deletions atomic/atoms/elements/lists.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "lists/unordered";
@import "lists/listitems";
3 changes: 3 additions & 0 deletions atomic/atoms/elements/lists/listitems.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
li {
list-style: none;
}
4 changes: 4 additions & 0 deletions atomic/atoms/elements/lists/unordered.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ul {
list-style: none;
width: 100%;
}
4 changes: 4 additions & 0 deletions atomic/atoms/elements/media.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "media/audio";
@import "media/svg";
@import "media/image";
@import "media/picture";
6 changes: 6 additions & 0 deletions atomic/atoms/elements/media/audio.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
audio {
&:not([controls]) {
display: none;
height: 0;
}
}
Loading

0 comments on commit aa09a4b

Please sign in to comment.