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

Set cursor:default for disabled radio buttons and checkboxes #519

Merged
merged 3 commits into from
Jul 10, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions app/views/guide_form_elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ <h4 class="heading-small">Stacked radio buttons</h4>
{% include "snippets/form_radio_buttons.html" %}
{% endfilter %}
</code>
</pre>

<h4 class="heading-small" id="form-radio-buttons-disabled">Disabled radio buttons</h4>
<div class="example">
{% include "snippets/form_radio_buttons_disabled.html" %}
</div>

<pre>
<code class="language-markup">
{% filter escape %}
{% include "snippets/form_radio_buttons_disabled.html" %}
{% endfilter %}
</code>
</pre>

<h3 class="heading-medium" id="form-checkboxes">Checkboxes</h3>
Expand All @@ -269,6 +282,19 @@ <h4 class="heading-small">Stacked checkboxes</h4>
{% include "snippets/form_checkboxes.html" %}
{% endfilter %}
</code>
</pre>

<h4 class="heading-small" id="form-checkboxes-disabled">Disabled checkboxes</h4>
<div class="example">
{% include "snippets/form_checkboxes_disabled.html" %}
</div>

<pre>
<code class="language-markup">
{% filter escape %}
{% include "snippets/form_checkboxes_disabled.html" %}
{% endfilter %}
</code>
</pre>

<p>
Expand Down
4 changes: 4 additions & 0 deletions app/views/snippets/form_checkboxes_disabled.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="multiple-choice">
<input id="checkbox-disabled-example" name="checkbox-disabled-group" type="checkbox" value="waste-farm-agricultural" disabled>
<label for="checkbox-disabled-example">Farm or agricultural waste</label>
</div>
4 changes: 4 additions & 0 deletions app/views/snippets/form_radio_buttons_disabled.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="multiple-choice">
<input id="radio-disabled-example" type="radio" name="radio-disabled-group" value="Isle of Man or the Channel Islands" disabled>
<label for="radio-disabled-example">Isle of Man or the Channel Islands</label>
</div>
5 changes: 5 additions & 0 deletions assets/sass/elements/forms/_form-multiple-choice.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@
}

// Disabled state
input:disabled {
cursor: default;
}

input:disabled + label {
@include opacity(0.5);
cursor: default;
}

&:last-child,
Expand Down