You can fetch Trowel List-groups with npm, yarn or bower.
# With bower
$ bower install --save trowel-list-groups
# With npm
$ npm install --save trowel-list-groups
# With yarn
$ yarn add trowel-list-groups
You can also download a zip archive right here.
The main scss file to include to your main .scss
file is located at the ./src/scss/list-groups.scss
. As a Trowel Component, it also requires two dependencies to compile the scss code. Here an scss installation snippet.
// Trowel core (need to be imported first)
@import './path/to/dependencies/trowel-core/src/trowel';
// Trowel List-groups
@import './path/to/dependencies/trowel-list-groups/src/scss/list-groups';
A list-group is just an unordered list with classes on <ul>
and <li>
DOM elements.
<ul class="list-group">
<li class="list-group__item">Cras justo odio</li>
<li class="list-group__item">Dapibus ac facilisis in</li>
<li class="list-group__item">Morbi leo risus</li>
<li class="list-group__item">Porta ac consectetur ac</li>
<li class="list-group__item">Vestibulum at eros</li>
</ul>
With the trowel variable $listgroups-item--background-color
we setup some modifier-element flag that allow us to create themed list-group items.
<ul class="list-group">
<li class="list-group__item list-group__item--primary">Cras justo odio</li>
<li class="list-group__item list-group__item--success">Morbi leo risus</li>
<li class="list-group__item list-group__item--warning">Vestibulum at eros</li>
<li class="list-group__item list-group__item--danger">Morbi leo risus</li>
</ul>
By default, the setup of the trowel variables generates modifiers classes that with different sizes for list-group.
<!-- Extra small list-group -->
<ul class="list-group list-group--xs">
<li class="list-group__item">list group xs</li>
<li class="list-group__item">item</li>
<li class="list-group__item">item</li>
</ul>
<!-- Small list-group -->
<ul class="list-group list-group--sm">
<li class="list-group__item">list group sm</li>
<li class="list-group__item">item</li>
<li class="list-group__item">item</li>
</ul>
<!-- Medium list-group -->
<ul class="list-group">
<li class="list-group__item">list group md</li>
<li class="list-group__item">item</li>
<li class="list-group__item">item</li>
</ul>
<!-- Large list-group -->
<ul class="list-group list-group--lg">
<li class="list-group__item">list group lg</li>
<li class="list-group__item">Dapibus ac facilisis in</li>
<li class="list-group__item">item</li>
</ul>
You can override the global syntax config for a specific component with the following variables
VARIABLE | DEFAULT VALUE | DESCRIPTION |
---|---|---|
$listgroups--syntax |
null |
syntax config for .list-group |
VARIABLE | DEFAULT VALUE | DESCRIPTION |
---|---|---|
$listgroups--font-size |
( |
sets the font-size property on .list-group |
$listgroups--font-family |
'Open Sans', verdana, sans-serif |
sets the font-family property on .list-group |
$listgroups--font-weight |
null |
sets the font-weight property on .list-group |
$listgroups--text-transform |
null |
sets the text-transform property on .list-group |
$listgroups--letter-spacing |
null |
sets the letter-spacing property on .list-group |
$listgroups--line-height |
1.2 |
sets the line-height property on .list-group |
$listgroups--text-align |
null |
sets the text-align property on .list-group |
$listgroups--text-decoration |
null |
sets the text-decoration property on .list-group |
$listgroups--margin |
0 0 1em |
sets the margin property on .list-group |
$listgroups--border-radius |
null |
sets the border-radius property on .list-group |
$listgroups--color |
null |
sets the color property on .list-group |
$listgroups--box-shadow |
null |
sets the box-shadow property on .list-group |
$listgroups--background |
null |
sets the background property on .list-group |
$listgroups--background-color |
null |
sets the background-color property on .list-group |
$listgroups--max-width |
null |
sets the max-width property on .list-group |
Item | ||
VARIABLE | DEFAULT VALUE | DESCRIPTION |
$listgroups-item--font-size |
null |
sets the font-size property on .list-group__item |
$listgroups-item--font-family |
null |
sets the font-family property on .list-group__item |
$listgroups-item--font-weight |
null |
sets the font-weight property on .list-group__item |
$listgroups-item--text-transform |
null |
sets the text-transform property on .list-group__item |
$listgroups-item--letter-spacing |
null |
sets the letter-spacing property on .list-group__item |
$listgroups-item--line-height |
null |
sets the line-height property on .list-group__item |
$listgroups-item--text-align |
null |
sets the text-align property on .list-group__item |
$listgroups-item--text-decoration |
null |
sets the text-decoration property on .list-group__item |
$listgroups-item--border-width |
1px |
sets the border-width property on .list-group__item |
$listgroups-item--border-style |
solid |
sets the border-style property on .list-group__item |
$listgroups-item--border-color |
( |
sets the border-color property on .list-group__item |
$listgroups-item--border-radius |
0.2em |
sets the border-radius property on .list-group__item |
$listgroups-item--color |
( |
sets the color property on .list-group__item |
$listgroups-item--box-shadow |
null |
sets the box-shadow property on .list-group__item |
$listgroups-item--background |
null |
sets the background property on .list-group__item |
$listgroups-item--background-color |
( |
sets the background-color property on .list-group__item |
$listgroups-item--padding |
0.65em 1.65em |
sets the padding property on .list-group__item |
$listgroups-item--z-index |
( |
sets the z-index property on .list-group__item |