From ad6dd09548585d079d89a8da194c604e24f3298b Mon Sep 17 00:00:00 2001 From: Nash Vail Date: Sat, 30 Jul 2016 11:36:26 +0530 Subject: [PATCH] Inputs: added multiple sizes, removed table layout --- demos/demos.css | 32 +++ demos/inputs.html | 432 +++++++++++++++++++++++++++++---- scss/atoms/inputs/_mixins.scss | 12 +- scss/variables/inputs.js | 19 +- 4 files changed, 435 insertions(+), 60 deletions(-) diff --git a/demos/demos.css b/demos/demos.css index c20ae8e..cfe6171 100644 --- a/demos/demos.css +++ b/demos/demos.css @@ -1,3 +1,14 @@ +.clearfix:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +* html .clearfix { zoom: 1; } /* IE6 */ +*:first-child+html .clearfix { zoom: 1; } /* IE7 */ + body { max-width: 900px; margin: 3em auto; @@ -9,3 +20,24 @@ ul { padding: 0; list-style-type: none; } + +.inputs-container { + box-sizing: border-box + width: 100%; +} + +.inputs-row { + width: 100%; +} + +.inputs-label { + width: 10%; + float: left; + padding: 0.25em 1em 0.25em 0; + text-align: right; +} + +.inputs-input { + width: 85%; + float: right; +} \ No newline at end of file diff --git a/demos/inputs.html b/demos/inputs.html index f35c4d5..5333d2e 100644 --- a/demos/inputs.html +++ b/demos/inputs.html @@ -73,40 +73,45 @@

Checkboxes and Radios

Inputs - Inline

- - - - - - - - - - - - - - - - - -
+
+
+
-
+ +
-
+ + + +
+
-
+ +
-
+ + + +
+
-
+ +
-
+ + + +
+
-
+ +
-
+ + + + +

Inputs

@@ -122,83 +127,408 @@

Inputs

-
-
- - -

Inputs (Disabled)

- + - + - + - +

Inputs (Readonly)

- - + + - + - + - +

Inputs (Focus)

- + - + - + - +

Inputs (Active)

- + - + - + - + +

Inputs (Warning)

+ + + + + + + + + + + + +

Inputs (Error)

- + - + - + + + + + +

Inputs - md

+ + + + + + + + + + + + + + +

Inputs (Disabled)

+ + + + + + + + + + + + + +

Inputs (Readonly)

+ + + + + + + + + + + + + +

Inputs (Focus)

+ + + + + + + + + + + + + +

Inputs (Active)

+ + + + + + + + + + + + + +

Inputs (Warning)

+ + + + + + + + + + + + + +

Inputs (Error)

+ + + + + + + + + + + + + + + + + + +

Inputs - lg

+ + + + + + + + + + + + + + +

Inputs (Disabled)

+ + + + + + + + + + + + + +

Inputs (Readonly)

+ + + + + + + + + + + + + +

Inputs (Focus)

+ + + + + + + + + + + + + +

Inputs (Active)

+ + + + + + + + + + + + + +

Inputs (Warning)

+ + + + + + + + + + + + + +

Inputs (Error)

+ + + + + + + + + + + + + + + + + + + +

Inputs - xs

+ + + + + + + + + + + + + + +

Inputs (Disabled)

+ + + + + + + + + + + + + +

Inputs (Readonly)

+ + + + + + + + + + + + + +

Inputs (Focus)

+ + + + + + + + + + + + + +

Inputs (Active)

+ + + + + + + + + + + + + +

Inputs (Warning)

+ + + + + + + + + + + + + +

Inputs (Error)

+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scss/atoms/inputs/_mixins.scss b/scss/atoms/inputs/_mixins.scss index 33bc1bb..6120bd7 100644 --- a/scss/atoms/inputs/_mixins.scss +++ b/scss/atoms/inputs/_mixins.scss @@ -11,7 +11,7 @@ $input-padding: em(map-get($inputs-input-full-width, padding)); @mixin input() { padding: $input-padding 0 $input-padding $input-padding; - margin: $margin; + margin: $margin 0 $margin 0; border: map-get($inputs-input-full-width, border); border-color: map-deep-get($inputs-input-full-width, border-color, light); background: map-deep-get($inputs-input-full-width, background, base); @@ -44,6 +44,10 @@ $input-padding: em(map-get($inputs-input-full-width, padding)); @include input-error(); } + &.warning { + @include input-warning(); + } + /* Sizes */ &.input-xs { @include input-xs(); @@ -104,13 +108,17 @@ $input-padding: em(map-get($inputs-input-full-width, padding)); box-shadow: map-get($inputs-shadows, inset), map-get($inputs-shadows, error); } +@mixin input-warning() { + border-color: map-deep-get($inputs-error, border-color, base) ; + box-shadow: map-get($inputs-shadows, inset), map-get($inputs-shadows, warning); +} + /* Labels */ @mixin input-label() { font-size: em(map-get($inputs-label, font-size)); display: map-get($inputs-label, display); max-width: map-get($inputs-label, max-width); - margin-bottom: em(map-get($inputs-label, margin)); &.input-label-md { @include input-label-md(); diff --git a/scss/variables/inputs.js b/scss/variables/inputs.js index 2d73bc2..e0babda 100644 --- a/scss/variables/inputs.js +++ b/scss/variables/inputs.js @@ -13,8 +13,9 @@ chassis.inputs = { name: "Styles for input shadows", value: { "inset": "inset 0px 2px 2px 0px rgba(0,0,0,0.10)", - "focus": "0px 0px 2px 1px #03a9f4", + "focus": "0px 0px 2px 1px #03A9F4", "error": "0px 0px 2px 1px #F44336", + "warning": "0px 0px 2px 1px #FF7043" } }, "transitions": { @@ -32,7 +33,7 @@ chassis.inputs = { "display": "inline", "max-width": "100%", "font-size": "20px", - "margin": "5px" + "margin": "0px" } }, "label-md": { @@ -56,15 +57,14 @@ chassis.inputs = { "label-error": { name: "Styles for error labels", value: { - color: () => "colors.error", - "font-weight": "400" + color: () => "colors.error" } }, "input-full-width": { name: "Generic styles for single line inputs", value: { "padding": "10px", - "margin": "0px", + "margin": "5px", "border": "1px solid", "border-color": () => "colors.text", "border-radius": "2px", @@ -107,8 +107,13 @@ chassis.inputs = { "error": { name: "Styles for error state of inputs", value: { - "border-color": () => "colors.error", - "background": () => "colors.error" + "border-color": () => "colors.error" + } + }, + "warning": { + name: "Styles for warning state inputs", + value: { + "border-color": () => "colors.warning" } }, "input-md": {