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

Update _base.scss #2444

Merged
merged 4 commits into from
Nov 27, 2024
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
49 changes: 41 additions & 8 deletions components/gc-chckbxrdio/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ fieldset.gc-chckbxrdio {

input[type="radio"],
input[type="checkbox"] {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
margin-left: 10px;
opacity: 0;
z-index: 2;

&[disabled] + label {
cursor: not-allowed;
Expand Down Expand Up @@ -77,6 +72,14 @@ fieldset.gc-chckbxrdio {
}
}

&:hover {
cursor: pointer;

+ label::before {
@include chckbxrdio-hover;
}
}

&:focus + label::before {
@include chckbxrdio-focus;
}
Expand Down Expand Up @@ -150,3 +153,33 @@ fieldset.gc-chckbxrdio {
}
}
}
@media (prefers-contrast: more) {
.gc-chckbxrdio {
input[type=checkbox] {
&:focus+label {
&::before {
border: 5px double #000;
}
}
}
input[type=radio] {
&:focus+label {
&::before {
border: 5px double #000;
}
}
}
input[type="radio"] {
&:checked {
+ {
label {
&::before {
outline: 10px solid #444;
outline-offset: -20px;
}
}
}
}
}
}
}
13 changes: 10 additions & 3 deletions components/gc-chckbxrdio/gc-chckbxrdio-doc-en.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>How to implement</h2>
<h2>Evaluation and report</h2>
<p>There is no evaluation and report available for this component.</p>

<h2>API (Version 1.0)</h2>
<h2>API (Version 1.0.1)</h2>
<table class="table table-bordered">
<tr>
<th>CSS Class</th>
Expand All @@ -75,7 +75,7 @@ <h2>API (Version 1.0)</h2>
<tr>
<td>Version 1.0</td>
<td>Version 1.0</td>
<td>Version 1.0</td>
<td>Version 1.0.1</td>
<td>n.a.</td>
</tr>
</table>
Expand Down Expand Up @@ -120,7 +120,7 @@ <h4>Variant: Tickbox (<code>.checkbox.gc-chckbxrdio</code>)</h4>
&lt;label for="template"&gt;Template&lt;/label&gt;
&lt;/div&gt;</code></pre>

<h3>Visual rendering (v1.0)</h3>
<h3>Visual rendering (v1.0.1)</h3>
<h4>Default</h4>
<dl>
<dt>Check box and radio</dt>
Expand Down Expand Up @@ -161,6 +161,13 @@ <h4>Tickbox</h4>
<details>
<summary>Version notes</summary>
<dl class="dl-horizontal">
<dt>Version 1.0.1</dt>
<dd>
<ul>
<li>Fixed radio buttons UI for users leveraging the high-contrast feature. Note: High-contrast functionality is not considered as essential component behavior (not included in the API).</li>
<li>Fixed display of hidden inputs so that they are accessible through Dragon Naturally Speak.</li>
</ul>
</dd>
<dt>Version 1.0</dt>
<dd>
<ul>
Expand Down
13 changes: 10 additions & 3 deletions components/gc-chckbxrdio/gc-chckbxrdio-doc-fr.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>Exemples pratiques</h2>
<h2>Évaluation et rapport</h2>
<p>Il n'y a pas d'évaluation et de rapport disponible pour ce composant.</p>

<h2>API (Version 1.0)</h2>
<h2>API (Version 1.0.1)</h2>
<table class="table table-bordered">
<tr>
<th>Classe CSS</th>
Expand All @@ -75,7 +75,7 @@ <h2>API (Version 1.0)</h2>
<tr>
<td>Version 1.0</td>
<td>Version 1.0</td>
<td>Version 1.0</td>
<td>Version 1.0.1</td>
<td>s.o.</td>
</tr>
</table>
Expand Down Expand Up @@ -117,7 +117,7 @@ <h4>Variation&nbsp;: Tickbox (<code>.checkbox.gc-chckbxrdio</code>)</h4>
&lt;label for="gabarit"&gt;Gabarit&lt;/label&gt;
&lt;/div&gt;</code></pre>

<h3>Rendu visuel (v1.0)</h3>
<h3>Rendu visuel (v1.0.1)</h3>
<h4>Base</h4>
<dl>
<dt>Cases à cocher et boutons radio</dt>
Expand Down Expand Up @@ -158,6 +158,13 @@ <h4 lang="en">Tickbox</h4>
<details>
<summary>Notes sur les versions</summary>
<dl class="dl-horizontal">
<dt>Version 1.0.1</dt>
<dd>
<ul>
<li>Support de la fonctionnalité de contraste élevé pour les boutons radios. Note: la fonctionnalité de contraste élevé n'est pas considérée comme comportement essentiel de la composante (n'est pas inclut dans l'API).</li>
<li>Les boutons radios et cases à cocher invisibles sont maintenant accessibles via Dragon Naturally Speak.</li>
</ul>
</dd>
<dt>Version 1.0</dt>
<dd>
<ul>
Expand Down