Skip to content

Commit

Permalink
Headings subtitle fix (#31)
Browse files Browse the repository at this point in the history
Fix Heading classNames mess #29

* removed the htmlFor prop on labels to allow nested label > input without an explicit htmlFor. fixes #27

* changed heading behaviour adding title and subtitle classes at same time. fixes #29

* Revert "removed the htmlFor prop on labels to allow nested label > input without an explicit htmlFor. fixes #27"

This reverts commit e6030c5.
  • Loading branch information
DimitarChristoff authored and couds committed May 15, 2018
1 parent f100f59 commit dd0126c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`Heading component Should be a subtitle with size rendered as P 1`] = `

exports[`Heading component Should be spaced 1`] = `
<p
className="title subtitle is-spaced"
className="title is-spaced"
style={Object {}}
>
Subtitle
Expand All @@ -20,7 +20,7 @@ exports[`Heading component Should be spaced 1`] = `

exports[`Heading component Should concat classname in props with Bulma classname 1`] = `
<h1
className="other-class this-is-a-test title subtitle"
className="other-class this-is-a-test title"
style={Object {}}
>
<p>
Expand All @@ -33,7 +33,7 @@ exports[`Heading component Should exist 1`] = `[Function]`;

exports[`Heading component Should have title classname 1`] = `
<h1
className="title subtitle"
className="title"
style={Object {}}
>
Test
Expand All @@ -54,7 +54,7 @@ exports[`Heading component Should not be spaced because is subtitle 1`] = `

exports[`Heading component Should use inline styles 1`] = `
<h1
className="title subtitle"
className="title"
style={
Object {
"height": 250,
Expand Down
2 changes: 1 addition & 1 deletion src/components/heading/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class Heading extends PureComponent {
{...props}
className={classnames(className, {
title: !subtitle && !heading,
subtitle: !heading,
subtitle,
heading,
[`is-${size}`]: size,
'is-spaced': spaced && !subtitle,
Expand Down

0 comments on commit dd0126c

Please sign in to comment.