<button class="filter-item" type="button">
<span class="filter-item__inner">
<span class="filter-item__text">Lorem ipsum</span>
</span>
</button>
{% set BEM -%}
filter-item
{%- if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isSelected %} is-selected{% endif %}
{% endset %}
<button class="{{ BEM }}" type="button"{% if data.isDisabled %} disabled{% endif %}{% if data.key %} data-key="{{ data.key }}"{% endif %}>
<span class="filter-item__inner">
{% if data.count %}
<span class="filter-item__bullet">
<span class="filter-item__count">{{ data.count }}</span>
</span>
{% endif %}
<span class="filter-item__text">{{ data.text }}</span>
</span>
</button>
{
"language": "en-US",
"data": {
"text": "Lorem ipsum"
}
}
.filter-item {
display: inline-block;
padding: 0;
background: $L-filter-bg;
border: none;
border-radius: $border-radius-small;
color: $L-text-black;
outline: none;
font-size: $font-size-base;
font-weight: $font-weight-regular;
letter-spacing: $letter-spacing-50;
line-height: $line-height-base;
-webkit-appearance: none;
cursor: pointer;
&:hover {
background: $L-filter-hover;
}
&:active {
background: $L-filter-active;
}
&:disabled {
cursor: not-allowed; // stylelint-disable-line
background: $L-filter-active;
color: $L-text-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-filter-active;
outline: 2px solid $L-filter-focus;
outline-offset: 2px;
}
&.is-selected {
background: $L-filter-selected;
&:hover {
background: $L-background-medium-hover;
}
&:active {
background: $L-background-medium-active;
}
&:disabled {
background: $L-background-medium-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-background-medium-hover;
}
}
}
.filter-item__inner {
display: flex;
align-items: center;
padding: 4px 16px;
}
.filter-item__bullet {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 18px;
width: 18px;
height: 18px;
margin-right: 6px;
background: $brand-primary;
border-radius: $border-radius-round;
color: $L-text-inverted;
font-size: $font-size-tiny;
font-weight: $font-weight-medium;
line-height: 1;
}
.filter-item__text {
display: inline-block;
}
import './filter-item.scss';
<button class="filter-item" type="button">
<span class="filter-item__inner">
<span class="filter-item__bullet">
<span class="filter-item__count">8</span>
</span>
<span class="filter-item__text">Lorem ipsum</span>
</span>
</button>
{% set BEM -%}
filter-item
{%- if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isSelected %} is-selected{% endif %}
{% endset %}
<button class="{{ BEM }}" type="button"{% if data.isDisabled %} disabled{% endif %}{% if data.key %} data-key="{{ data.key }}"{% endif %}>
<span class="filter-item__inner">
{% if data.count %}
<span class="filter-item__bullet">
<span class="filter-item__count">{{ data.count }}</span>
</span>
{% endif %}
<span class="filter-item__text">{{ data.text }}</span>
</span>
</button>
{
"language": "en-US",
"data": {
"text": "Lorem ipsum",
"count": 8
}
}
.filter-item {
display: inline-block;
padding: 0;
background: $L-filter-bg;
border: none;
border-radius: $border-radius-small;
color: $L-text-black;
outline: none;
font-size: $font-size-base;
font-weight: $font-weight-regular;
letter-spacing: $letter-spacing-50;
line-height: $line-height-base;
-webkit-appearance: none;
cursor: pointer;
&:hover {
background: $L-filter-hover;
}
&:active {
background: $L-filter-active;
}
&:disabled {
cursor: not-allowed; // stylelint-disable-line
background: $L-filter-active;
color: $L-text-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-filter-active;
outline: 2px solid $L-filter-focus;
outline-offset: 2px;
}
&.is-selected {
background: $L-filter-selected;
&:hover {
background: $L-background-medium-hover;
}
&:active {
background: $L-background-medium-active;
}
&:disabled {
background: $L-background-medium-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-background-medium-hover;
}
}
}
.filter-item__inner {
display: flex;
align-items: center;
padding: 4px 16px;
}
.filter-item__bullet {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 18px;
width: 18px;
height: 18px;
margin-right: 6px;
background: $brand-primary;
border-radius: $border-radius-round;
color: $L-text-inverted;
font-size: $font-size-tiny;
font-weight: $font-weight-medium;
line-height: 1;
}
.filter-item__text {
display: inline-block;
}
import './filter-item.scss';
<button class="filter-item is-selected" type="button">
<span class="filter-item__inner">
<span class="filter-item__text">Lorem ipsum</span>
</span>
</button>
{% set BEM -%}
filter-item
{%- if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isSelected %} is-selected{% endif %}
{% endset %}
<button class="{{ BEM }}" type="button"{% if data.isDisabled %} disabled{% endif %}{% if data.key %} data-key="{{ data.key }}"{% endif %}>
<span class="filter-item__inner">
{% if data.count %}
<span class="filter-item__bullet">
<span class="filter-item__count">{{ data.count }}</span>
</span>
{% endif %}
<span class="filter-item__text">{{ data.text }}</span>
</span>
</button>
{
"language": "en-US",
"data": {
"text": "Lorem ipsum",
"isSelected": true
}
}
.filter-item {
display: inline-block;
padding: 0;
background: $L-filter-bg;
border: none;
border-radius: $border-radius-small;
color: $L-text-black;
outline: none;
font-size: $font-size-base;
font-weight: $font-weight-regular;
letter-spacing: $letter-spacing-50;
line-height: $line-height-base;
-webkit-appearance: none;
cursor: pointer;
&:hover {
background: $L-filter-hover;
}
&:active {
background: $L-filter-active;
}
&:disabled {
cursor: not-allowed; // stylelint-disable-line
background: $L-filter-active;
color: $L-text-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-filter-active;
outline: 2px solid $L-filter-focus;
outline-offset: 2px;
}
&.is-selected {
background: $L-filter-selected;
&:hover {
background: $L-background-medium-hover;
}
&:active {
background: $L-background-medium-active;
}
&:disabled {
background: $L-background-medium-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-background-medium-hover;
}
}
}
.filter-item__inner {
display: flex;
align-items: center;
padding: 4px 16px;
}
.filter-item__bullet {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 18px;
width: 18px;
height: 18px;
margin-right: 6px;
background: $brand-primary;
border-radius: $border-radius-round;
color: $L-text-inverted;
font-size: $font-size-tiny;
font-weight: $font-weight-medium;
line-height: 1;
}
.filter-item__text {
display: inline-block;
}
import './filter-item.scss';
<button class="filter-item" type="button" disabled>
<span class="filter-item__inner">
<span class="filter-item__text">Lorem ipsum</span>
</span>
</button>
{% set BEM -%}
filter-item
{%- if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isSelected %} is-selected{% endif %}
{% endset %}
<button class="{{ BEM }}" type="button"{% if data.isDisabled %} disabled{% endif %}{% if data.key %} data-key="{{ data.key }}"{% endif %}>
<span class="filter-item__inner">
{% if data.count %}
<span class="filter-item__bullet">
<span class="filter-item__count">{{ data.count }}</span>
</span>
{% endif %}
<span class="filter-item__text">{{ data.text }}</span>
</span>
</button>
{
"language": "en-US",
"data": {
"text": "Lorem ipsum",
"isDisabled": true
}
}
.filter-item {
display: inline-block;
padding: 0;
background: $L-filter-bg;
border: none;
border-radius: $border-radius-small;
color: $L-text-black;
outline: none;
font-size: $font-size-base;
font-weight: $font-weight-regular;
letter-spacing: $letter-spacing-50;
line-height: $line-height-base;
-webkit-appearance: none;
cursor: pointer;
&:hover {
background: $L-filter-hover;
}
&:active {
background: $L-filter-active;
}
&:disabled {
cursor: not-allowed; // stylelint-disable-line
background: $L-filter-active;
color: $L-text-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-filter-active;
outline: 2px solid $L-filter-focus;
outline-offset: 2px;
}
&.is-selected {
background: $L-filter-selected;
&:hover {
background: $L-background-medium-hover;
}
&:active {
background: $L-background-medium-active;
}
&:disabled {
background: $L-background-medium-disabled;
}
html[data-whatinput='keyboard'] &:focus {
background: $L-background-medium-hover;
}
}
}
.filter-item__inner {
display: flex;
align-items: center;
padding: 4px 16px;
}
.filter-item__bullet {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 18px;
width: 18px;
height: 18px;
margin-right: 6px;
background: $brand-primary;
border-radius: $border-radius-round;
color: $L-text-inverted;
font-size: $font-size-tiny;
font-weight: $font-weight-medium;
line-height: 1;
}
.filter-item__text {
display: inline-block;
}
import './filter-item.scss';