refactor: 💡 extract helper-text styles

This commit is contained in:
Randall Morey committed 2020-08-05 10:54:25 -04:00
1 parent aa7bf350d9
commit ce6fb31c96
10 files changed
+18 -22

No files matched your search

@@ -0,0 +1,9 @@
@use '../../variables/sizing';
@use '../../utilities/type';
.rose-form-helper-text {
@include type.type(xs);
display: block;
color: var(--ui-gray);
margin-bottom: sizing.rems(xxs);
}
@@ -3,3 +3,4 @@
@import 'select';
@import 'radio';
@import 'errors';
@import 'helper-text';
@@ -10,13 +10,6 @@
margin-bottom: sizing.rems(xxs);
}
.rose-form-input-helper-text {
@include type.type(xs);
display: block;
color: var(--ui-gray);
margin-bottom: sizing.rems(xxs);
}
.rose-form-input-field {
@include type.type(m);
box-sizing: border-box;
@@ -54,7 +47,7 @@
&.error {
color: var(--failure);
.rose-form-input-helper-text {
.rose-form-helper-text {
color: currentColor;
}
@@ -10,13 +10,6 @@
margin-bottom: sizing.rems(xxs);
}
.rose-form-select-helper-text {
@include type.type(xs);
display: block;
color: var(--ui-gray);
margin-bottom: sizing.rems(xxs);
}
.rose-form-select-field {
@include type.type(s);
-webkit-appearance: none;
@@ -59,7 +52,7 @@
&.error {
color: var(--failure);
.rose-form-select-helper-text {
.rose-form-helper-text {
color: currentColor;
}
@@ -6,7 +6,7 @@
{{#if @helperText}}
<span
class="rose-form-input-helper-text"
class="rose-form-helper-text"
id="helper-text-{{this.id}}">
{{@helperText}}
</span>
@@ -6,7 +6,7 @@
{{#if @helperText}}
<span
class="rose-form-select-helper-text"
class="rose-form-helper-text"
id="helper-text-{{this.id}}">
{{@helperText}}
</span>
@@ -6,7 +6,7 @@
{{#if @helperText}}
<span
class="rose-form-input-helper-text"
class="rose-form-helper-text"
id="helper-text-{{this.id}}">
{{@helperText}}
</span>
@@ -17,7 +17,7 @@ module('Integration | Component | rose/form/input', function (hooks) {
const fieldEl = find('input');
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-input-helper-text');
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);
@@ -44,7 +44,7 @@ module('Integration | Component | rose/form/select', function (hooks) {
const fieldEl = find('select');
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-select-helper-text');
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);
@@ -17,7 +17,7 @@ module('Integration | Component | rose/form/textarea', function (hooks) {
const fieldEl = find('textarea');
const id = fieldEl.id;
const helperId = `helper-text-${id}`;
const helperTextEl = find('.rose-form-input-helper-text');
const helperTextEl = find('.rose-form-helper-text');
assert.equal(helperTextEl.textContent.trim(), 'Help me');
assert.equal(helperTextEl.id, helperId);
assert.equal(fieldEl.getAttribute('aria-describedby').trim(), helperId);