Skip to content

Commit

Permalink
#261 update heading styles, add BEM modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrankowska committed May 8, 2020
1 parent 06b7849 commit d0b26d5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/atoms/heading/Heading.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
[`a-heading a-heading--${levelClassName}-level`]: level
}"
>
<!-- @slot Slot for heading content -->
<slot />
</component>
45 changes: 33 additions & 12 deletions src/atoms/heading/Heading.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
@import '../../../assets/styles/_globals.scss';

$headings-margin : 0 0 0.5em 0 !default;
$headings-font-family : $font-family-base !default;
$headings-font-weight : 700 !default;
$headings-line-height : $font-line-height !default;
$headings-color : $color-secondary !default;
$headings-text-transform : none !default;
$heading-font-size--first-level : 18px !default;
$heading-font-size--second-level: 18px !default;
$heading-font-size--third-level : 14px !default;
$heading-font-size--fourth-level: 14px !default;
$heading-font-size--fifth-level : 12px !default;
$heading-font-size--sixth-level : 12px !default;
$headings-margin : 0 0 0.5em 0 !default;
$headings-font-family : $font-family-secondary !default;
$headings-font-family--secondary : $font-family-base !default;
$headings-font-weight : $font-weight-medium !default;
$headings-line-height : $font-line-height !default;
$headings-color : $color-primary !default;
$headings-text-transform : uppercase !default;

$heading-font-size--first-level\@screen-m : $font-size-super-extra-large !default;
$heading-font-size--first-level : $font-size-extra-large !default;
$heading-font-size--second-level\@screen-m: $font-size-extra-large !default;
$heading-font-size--second-level : $font-size-large !default;
$heading-font-size--third-level\@screen-m : $font-size-large !default;
$heading-font-size--third-level : $font-size-medium !default;
$heading-font-size--fourth-level : $font-size-medium !default;
$heading-font-size--fifth-level : $font-size-medium !default;
$heading-font-size--sixth-level : $font-size-medium !default;

.a-heading {
margin: $headings-margin;
Expand All @@ -23,14 +28,26 @@ $heading-font-size--sixth-level : 12px !default;

&--first-level {
font-size: $heading-font-size--first-level;

@include mq($screen-m) {
font-size: $heading-font-size--first-level\@screen-m;
}
}

&--second-level {
font-size: $heading-font-size--second-level;

@include mq($screen-m) {
font-size: $heading-font-size--second-level\@screen-m;
}
}

&--third-level {
font-size: $heading-font-size--third-level;

@include mq($screen-m) {
font-size: $heading-font-size--third-level\@screen-m;
}
}

&--fourth-level {
Expand All @@ -44,4 +61,8 @@ $heading-font-size--sixth-level : 12px !default;
&--sixth-level {
font-size: $heading-font-size--sixth-level;
}

&--font-secondary {
font-family: $headings-font-family--secondary;
}
}
6 changes: 6 additions & 0 deletions src/atoms/heading/Heading.selectors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"name": ".a-heading--font-secondary",
"description": "Selector for applying secondary styles"
}
]
14 changes: 13 additions & 1 deletion src/atoms/heading/Heading.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ import { storiesOf } from '@storybook/vue'
import AHeading from './Heading.vue'
import { select, text } from '@storybook/addon-knobs'

const info = 'Check **Knobs** tab to edit component properties dynamically, All HTML six levels of headings are available.'
import generateVueInfoTable from '@utils/helpers/generate-vue-info-table.js'
import getClassKnobsConfig from '@utils/helpers/get-class-knobs-config.js'
import selectorsConfig from './Heading.selectors.json'

const info = `
<p>Check <b>Knobs</b> tab to edit component properties dynamically. All HTML six levels of headings are available.</p><br>
${generateVueInfoTable(selectorsConfig, 'BEM modifiers')}
`
const classKnobsConfig = getClassKnobsConfig(selectorsConfig)

const levels = [1, 2, 3, 4, 5, 6]

Expand All @@ -20,12 +28,16 @@ storiesOf('Atoms/Heading', module)
},
textKnobs: {
default: text('Text', 'Heading level 1')
},
classKnob: {
default: select('BEM Modifier', classKnobsConfig)
}
},
template: `
<a-heading
:level="levelKnobs"
:tag="tagKnobs"
:class="classKnob"
>
{{ textKnobs }}
</a-heading>
Expand Down

0 comments on commit d0b26d5

Please sign in to comment.