3 #demo Demo
The source files for this demo can be found in the demo folder on GitHub.
Source:
kss-headings.less
, line 27
3.1 #demo.mixins Mixins
LESS mixins used in this demo.
Source:
styles.less
, line 21
3.1.2 #demo.mixins.example .colors(@bg, @color)
Applies foreground and background colors.
Parameters:
-
@bg
Background color.Defaults to:#f5f5f5
-
@color
Foreground color.Defaults to:#900
Source:
mixins/example.less
, line 1
Source:
styles.less
, line 1
3.3 #demo.components Components
Reusable components that can be used across the site. So far this just includes buttons.
Source:
styles.less
, line 30
3.4 #demo.forms Forms
Covers styles used for forms, such as the <input>
and <select>
elements.
Example
Markup: forms/forms.hbs
{{!-- Handlebars partials can nest other section's partials. --}}
<form>
<p>{{> "demo.forms.text.single-line" }}</p>
{{> "demo.forms.text.label-pairs" }}
<p>
{{> "buttons" }}
</p>
</form>
Source:
styles.less
, line 38
3.4.1 #demo.forms.text Text Input
Below are the text-oriented form elements used on the site.
Source:
forms/base.less
, line 1
3.4.1.1 #demo.forms.text.single-line Single-Line Text Boxes
Your standard, everyday text boxes.
Examples
Default styling
:hover
Highlight the text box when hovering
:focus
Similar to
:hover
, however it should demand more attention than when an input is simply hovered.
:disabled
When disabled, the input's appearance should reflect as such.
Markup
<input type="text" class="[modifier class]" value="Text input"/>
Source:
forms/base.less
, line 8
3.4.1.2 #demo.forms.text.label-pairs Label/Text box Pairs
All labelled text boxes should be included in a wrapper <div>
element for
both layout convenience and specific styling.
Examples
Default styling
.disabled
Use this class when the text input inside is expected to be disabled.
.invalid
Use this class if the input has failed a validation check.
.valid
Use this class if the input has passed a validation check (intended for live validation in particular).
Markup
<div class="mod-input text [modifier class]">
<label>Text Label</label>
<input type="text" class="" value="Text input"/></div>
Source:
forms/base.less
, line 58