<div class="check">
<input type="checkbox" id="check1" name="check" value="" class="check__input">
<label for="check1" class="check__label">
<span class="check__indicator">
<svg class="icon check__icon">
<use xlink:href="../../inc/svg/global.49d3f64de1a3f5ccf16c763316702027.svg#checkbox-crossed-big"></use>
</svg>
</span>
<span class="check__text">Checkbox label</span>
</label>
</div>
{% set BEM -%}
check
{% if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isDisabled %} is-disabled{% endif %}
{% endset %}
<div class="{{ BEM }}">
<input
type="checkbox"
id="{{ data.id }}"
name="{{ data.name }}"
value="{{ data.value }}"
class="check__input"
{% if data.isChecked %}checked{% endif %}
{% if data.isDisabled %}disabled{% endif %}
{{ data.attributes }}
>
<label for="{{ data.id }}" class="check__label" >
<span class="check__indicator">
{% include '@icon' with { class: 'check__icon', name: 'checkbox-crossed-big' } %}
</span>
<span class="check__text">{{ data.label }}</span>
</label>
</div>
{
"language": "en-US",
"data": {
"label": "Checkbox label",
"id": "check1",
"name": "check"
}
}
.check {
position: relative;
}
.check__input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.check__label {
display: flex;
flex-direction: row;
justify-content: flex-start;
transition: opacity $transition-duration $transition-easing;
cursor: pointer;
.check__input:not(:disabled):hover ~ & {
@media (hover: hover) {
opacity: .6;
}
}
.check__input:disabled ~ & {
opacity: .3;
}
}
.check__text {
vertical-align: bottom;
line-height: 16px;
padding-top: 1px;
@include bp(sm-min) {
padding-top: 2px;
line-height: 24px;
}
}
.check__indicator {
position: relative;
display: inline-block;
height: 16px;
width: 16px;
margin-right: 4px;
@include bp(sm-min) {
margin-right: 8px;
width: 24px;
height: 24px;
}
&:before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
box-shadow: 0 0 0 1px var(--color-brand) inset;
transition: $transition-duration $transition-easing;
transition-property: box-shadow;
@include bp(sm-min) {
top: 3px;
left: 3px;
width: 18px;
height: 18px;
}
}
}
.check__icon {
position: absolute;
top: 0;
left: 0;
opacity: 0;
pointer-events: none;
font-size: 16px;
@include bp(sm-min) {
font-size: 24px;
}
.check__input:checked ~ .check__label & {
opacity: 1;
}
}
import './check.scss';
<div class="check is-disabled">
<input type="checkbox" id="check1" name="check" value="" class="check__input" disabled>
<label for="check1" class="check__label">
<span class="check__indicator">
<svg class="icon check__icon">
<use xlink:href="../../inc/svg/global.49d3f64de1a3f5ccf16c763316702027.svg#checkbox-crossed-big"></use>
</svg>
</span>
<span class="check__text">Checkbox label</span>
</label>
</div>
{% set BEM -%}
check
{% if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isDisabled %} is-disabled{% endif %}
{% endset %}
<div class="{{ BEM }}">
<input
type="checkbox"
id="{{ data.id }}"
name="{{ data.name }}"
value="{{ data.value }}"
class="check__input"
{% if data.isChecked %}checked{% endif %}
{% if data.isDisabled %}disabled{% endif %}
{{ data.attributes }}
>
<label for="{{ data.id }}" class="check__label" >
<span class="check__indicator">
{% include '@icon' with { class: 'check__icon', name: 'checkbox-crossed-big' } %}
</span>
<span class="check__text">{{ data.label }}</span>
</label>
</div>
{
"language": "en-US",
"data": {
"label": "Checkbox label",
"id": "check1",
"name": "check",
"isDisabled": true
}
}
.check {
position: relative;
}
.check__input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.check__label {
display: flex;
flex-direction: row;
justify-content: flex-start;
transition: opacity $transition-duration $transition-easing;
cursor: pointer;
.check__input:not(:disabled):hover ~ & {
@media (hover: hover) {
opacity: .6;
}
}
.check__input:disabled ~ & {
opacity: .3;
}
}
.check__text {
vertical-align: bottom;
line-height: 16px;
padding-top: 1px;
@include bp(sm-min) {
padding-top: 2px;
line-height: 24px;
}
}
.check__indicator {
position: relative;
display: inline-block;
height: 16px;
width: 16px;
margin-right: 4px;
@include bp(sm-min) {
margin-right: 8px;
width: 24px;
height: 24px;
}
&:before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
box-shadow: 0 0 0 1px var(--color-brand) inset;
transition: $transition-duration $transition-easing;
transition-property: box-shadow;
@include bp(sm-min) {
top: 3px;
left: 3px;
width: 18px;
height: 18px;
}
}
}
.check__icon {
position: absolute;
top: 0;
left: 0;
opacity: 0;
pointer-events: none;
font-size: 16px;
@include bp(sm-min) {
font-size: 24px;
}
.check__input:checked ~ .check__label & {
opacity: 1;
}
}
import './check.scss';
<div class="check">
<input type="checkbox" id="check1" name="check" value="" class="check__input" checked>
<label for="check1" class="check__label">
<span class="check__indicator">
<svg class="icon check__icon">
<use xlink:href="../../inc/svg/global.49d3f64de1a3f5ccf16c763316702027.svg#checkbox-crossed-big"></use>
</svg>
</span>
<span class="check__text">Checkbox label</span>
</label>
</div>
{% set BEM -%}
check
{% if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isDisabled %} is-disabled{% endif %}
{% endset %}
<div class="{{ BEM }}">
<input
type="checkbox"
id="{{ data.id }}"
name="{{ data.name }}"
value="{{ data.value }}"
class="check__input"
{% if data.isChecked %}checked{% endif %}
{% if data.isDisabled %}disabled{% endif %}
{{ data.attributes }}
>
<label for="{{ data.id }}" class="check__label" >
<span class="check__indicator">
{% include '@icon' with { class: 'check__icon', name: 'checkbox-crossed-big' } %}
</span>
<span class="check__text">{{ data.label }}</span>
</label>
</div>
{
"language": "en-US",
"data": {
"label": "Checkbox label",
"id": "check1",
"name": "check",
"isChecked": true
}
}
.check {
position: relative;
}
.check__input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.check__label {
display: flex;
flex-direction: row;
justify-content: flex-start;
transition: opacity $transition-duration $transition-easing;
cursor: pointer;
.check__input:not(:disabled):hover ~ & {
@media (hover: hover) {
opacity: .6;
}
}
.check__input:disabled ~ & {
opacity: .3;
}
}
.check__text {
vertical-align: bottom;
line-height: 16px;
padding-top: 1px;
@include bp(sm-min) {
padding-top: 2px;
line-height: 24px;
}
}
.check__indicator {
position: relative;
display: inline-block;
height: 16px;
width: 16px;
margin-right: 4px;
@include bp(sm-min) {
margin-right: 8px;
width: 24px;
height: 24px;
}
&:before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
box-shadow: 0 0 0 1px var(--color-brand) inset;
transition: $transition-duration $transition-easing;
transition-property: box-shadow;
@include bp(sm-min) {
top: 3px;
left: 3px;
width: 18px;
height: 18px;
}
}
}
.check__icon {
position: absolute;
top: 0;
left: 0;
opacity: 0;
pointer-events: none;
font-size: 16px;
@include bp(sm-min) {
font-size: 24px;
}
.check__input:checked ~ .check__label & {
opacity: 1;
}
}
import './check.scss';
<div class="check is-disabled">
<input type="checkbox" id="check1" name="check" value="" class="check__input" checked disabled>
<label for="check1" class="check__label">
<span class="check__indicator">
<svg class="icon check__icon">
<use xlink:href="../../inc/svg/global.49d3f64de1a3f5ccf16c763316702027.svg#checkbox-crossed-big"></use>
</svg>
</span>
<span class="check__text">Checkbox label</span>
</label>
</div>
{% set BEM -%}
check
{% if modifier %} {{ modifier }}{% endif %}
{%- if class %} {{ class }}{% endif %}
{%- if data.isDisabled %} is-disabled{% endif %}
{% endset %}
<div class="{{ BEM }}">
<input
type="checkbox"
id="{{ data.id }}"
name="{{ data.name }}"
value="{{ data.value }}"
class="check__input"
{% if data.isChecked %}checked{% endif %}
{% if data.isDisabled %}disabled{% endif %}
{{ data.attributes }}
>
<label for="{{ data.id }}" class="check__label" >
<span class="check__indicator">
{% include '@icon' with { class: 'check__icon', name: 'checkbox-crossed-big' } %}
</span>
<span class="check__text">{{ data.label }}</span>
</label>
</div>
{
"language": "en-US",
"data": {
"label": "Checkbox label",
"id": "check1",
"name": "check",
"isChecked": true,
"isDisabled": true
}
}
.check {
position: relative;
}
.check__input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.check__label {
display: flex;
flex-direction: row;
justify-content: flex-start;
transition: opacity $transition-duration $transition-easing;
cursor: pointer;
.check__input:not(:disabled):hover ~ & {
@media (hover: hover) {
opacity: .6;
}
}
.check__input:disabled ~ & {
opacity: .3;
}
}
.check__text {
vertical-align: bottom;
line-height: 16px;
padding-top: 1px;
@include bp(sm-min) {
padding-top: 2px;
line-height: 24px;
}
}
.check__indicator {
position: relative;
display: inline-block;
height: 16px;
width: 16px;
margin-right: 4px;
@include bp(sm-min) {
margin-right: 8px;
width: 24px;
height: 24px;
}
&:before {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 12px;
height: 12px;
box-shadow: 0 0 0 1px var(--color-brand) inset;
transition: $transition-duration $transition-easing;
transition-property: box-shadow;
@include bp(sm-min) {
top: 3px;
left: 3px;
width: 18px;
height: 18px;
}
}
}
.check__icon {
position: absolute;
top: 0;
left: 0;
opacity: 0;
pointer-events: none;
font-size: 16px;
@include bp(sm-min) {
font-size: 24px;
}
.check__input:checked ~ .check__label & {
opacity: 1;
}
}
import './check.scss';