Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#183] Add style for radios #193

Merged
merged 1 commit into from Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -12240,6 +12240,7 @@ form > .form-actions:last-child {
margin-bottom: 1.5rem;
}

.form-radios .form-item + .form-item,
.form-checkboxes .form-item + .form-item {
margin-top: 0.5rem;
}
Expand All @@ -12253,7 +12254,9 @@ form > .form-actions:last-child {
.form-check svg {
font-size: 1.3rem;
position: absolute;
top: 2px;
}
.form-check .fa-dot-circle,
.form-check .fa-check-square {
color: var(--ak-accent-color);
}
Expand Down
@@ -1,5 +1,6 @@
// Style for checkboxes
// -----------------------------------------------------------------------------
.form-radios,
.form-checkboxes {

.form-item {
Expand All @@ -20,8 +21,10 @@
svg {
font-size: 1.3rem;
position: absolute;
top: 2px;
}

.fa-dot-circle,
.fa-check-square {
color: var(--ak-accent-color);
}
Expand Down
@@ -0,0 +1,49 @@
{#
/**
* @file
* Template for a radio form element.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'js-form-item',
'form-item',
'js-form-type-' ~ type|clean_class,
'form-item-' ~ name|clean_class,
'js-form-item-' ~ name|clean_class,
title_display not in ['after', 'before'] ? 'form-no-label',
disabled == 'disabled' ? 'form-disabled',
errors ? 'form-item--error',
'form-check',
]
%}
{%
set description_classes = [
'description',
'form-text',
'text-muted',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<div{{ attributes.addClass(classes) }}>
{{ children }}

<i class="fas fa-dot-circle"></i>
<i class="far fa-circle"></i>

{{ label }}

{% if errors %}
<div class="form-item--error-message">
{{ errors }}
</div>
{% endif %}

{% if description.content %}
<small{{ description.attributes.addClass(description_classes) }}>
{{ description.content }}
</small>
{% endif %}
</div>