From 1b489cbde8b3d2fbeb81cd2f91b80bbc9dcfcd4b Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 3 Oct 2014 15:44:00 -0400 Subject: [PATCH] Adds #570 labeled inputs --- RELEASE NOTES.md | 1 + src/definitions/elements/input.less | 70 +++++++++++++++++-- .../packages/default/elements/input.variables | 7 +- 3 files changed, 69 insertions(+), 9 deletions(-) diff --git a/RELEASE NOTES.md b/RELEASE NOTES.md index e4f1f0d87..75ae187d9 100755 --- a/RELEASE NOTES.md +++ b/RELEASE NOTES.md @@ -13,6 +13,7 @@ - **Accordion** - Accordions are not unstyled by default allowing for more compatability with other modules without having to override styles. Styled accordions are now included as a variation ``ui styled accordion`` - **Item** - Items have now been renamed "card" to allow for a more generic item list that does not use a "card" style. Some 'card' view content has been slightly adjusted. Please refer to documentation - **Header / Icon** - Inverted headers and icons no longer invert background colors, but instead use a lighter version of colors more legible on dark backgrounds. Inverted circular icons, still however invert the color of the circle. +- **Input** - Labeled inputs now have ``corner`` ``left`` and ``top`` labels. Any labeled inputs must now be converted to ``corner labeled input`` to maintain default position in ``0.x`` - **Modal** - AllowMultiple (allowing multiple modals at once) is now set to **false** by default. - **Table** - Tables are no longer striped by default, instead you must specify the 'striped' variation diff --git a/src/definitions/elements/input.less b/src/definitions/elements/input.less index 48e543116..b90f6c778 100755 --- a/src/definitions/elements/input.less +++ b/src/definitions/elements/input.less @@ -236,10 +236,63 @@ Labeled ---------------------*/ + +/* Adjacent Label */ +.ui.labeled.input { + display: table; +} +.ui.labeled.input > input { + display: table-cell; + vertical-align: top; +} +.ui.labeled.input > .label { + display: table-cell; + vertical-align: middle; + white-space: nowrap; + font-size: 1em; +} +.ui.labeled.input > .label > .icon { + display: inline; + vertical-align: top; +} + +/* Fluid Labeled */ +.ui.fluid.labeled.input { + display: table; + width: 100%; +} +.ui.fluid.labeled.input > .label { + width: 0.01%; +} + +/* Label on Left */ +.ui.labeled.input:not([class*="corner labeled"]):not([class*="right labeled"]) > input { + border-left: none; + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; +} +.ui.labeled.input:not([class*="corner labeled"]):not([class*="right labeled"]) > .label { + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; +} + +/* Label on Right */ +.ui[class*="right labeled"].input > input { + border-right: none; + border-top-right-radius: 0px !important; + border-bottom-right-radius: 0px !important; +} +.ui[class*="right labeled"].input > .label { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; +} + + +/* Corner Label */ .ui.labeled.input .corner.label { - top: @labelTop; - right: @labelRight; - font-size: @labelSize; + top: @labelCornerTop; + right: @labelCornerRight; + font-size: @labelCornerSize; border-radius: 0em @borderRadius 0em 0em; } .ui.labeled.input input { @@ -247,14 +300,19 @@ } /* Spacing with corner label */ -.ui.labeled.icon.input:not(.left) > input { +.ui[class*="corner labeled"].input { + display: inline-block; +} +.ui[class*="corner labeled"].input > input { + display: block; +} +.ui[class*="corner labeled"].icon.input:not(.left) > input { padding-right: @labeledIconInputMargin !important; } -.ui.labeled.icon.input:not(.left) > .icon { +.ui[class*="corner labeled"].icon.input:not(.left) > .icon { margin-right: @labeledIconMargin; } - /*-------------------- Action ---------------------*/ diff --git a/src/themes/packages/default/elements/input.variables b/src/themes/packages/default/elements/input.variables index 96875783f..0a8440751 100755 --- a/src/themes/packages/default/elements/input.variables +++ b/src/themes/packages/default/elements/input.variables @@ -49,9 +49,10 @@ @circularIconHorizontalOffset: 0.5em; /* Labeled Input */ -@labelTop: @borderWidth; -@labelRight: @borderWidth; -@labelSize: 0.75em; +@labelCornerTop: @borderWidth; +@labelCornerRight: @borderWidth; +@labelCornerSize: 0.75em; +@labelSize: 1em; @labeledMargin: 2.5em; @labeledIconInputMargin: 3.25em;