Skip to content

Commit

Permalink
Moved form label font styles to a mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Dec 19, 2019
1 parent c53be3b commit ece87b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src-docs/src/views/form_controls/radio_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class extends Component {
idSelected={this.state.radioIdSelected}
onChange={this.onChange}
name="radio group"
legend={{
children: <span>This is a legend for a radio group</span>,
// display: 'hidden',
}}
/>

<EuiSpacer size="m" />
Expand Down
4 changes: 1 addition & 3 deletions src/components/form/form_label/_form_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
* 1. Focused state overrides invalid state.
*/
.euiFormLabel {
@include euiFontSizeXS;
@include euiFormLabel;
display: inline-block;
transition: all $euiAnimSpeedFast $euiAnimSlightResistance;
color: $euiTitleColor;
font-weight: $euiFontWeightSemiBold;

&.euiFormLabel-isInvalid {
color: $euiColorDanger; /* 1 */
Expand Down
7 changes: 7 additions & 0 deletions src/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// Labels
@mixin euiFormLabel {
@include euiFontSizeXS;
color: $euiTitleColor;
font-weight: $euiFontWeightSemiBold;
}

@mixin euiFormControlLayoutPadding($numOfIcons, $side: 'right', $compressed: false) {
$firstIconSize: $euiFormControlPadding + $euiSize + $euiFormControlPadding;
$secondIconSize: $euiFormControlPadding + $euiSize;
Expand Down

0 comments on commit ece87b0

Please sign in to comment.