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

Feautre/261 Heading component review #266

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
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;
anqaka marked this conversation as resolved.
Show resolved Hide resolved
$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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I can see it should not be uppercase by 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should do it as simple as possible. Maybe it would be good do keep 1 size for one heading for now? @anqaka WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding to UX, I think smaller font-size for h1 and h2 for mobile view is often requested and useful, not sure about h3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, lets leave this problem for now

$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"
anqaka marked this conversation as resolved.
Show resolved Hide resolved
>
{{ textKnobs }}
</a-heading>
Expand Down