Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions docs/contents/style/03-typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
### Headings

{{#example 'html'}}
<h1>h1. Heading</h1> <!-- 35px -->
<h2>h2. Heading</h2> <!-- 28px -->
<h3>h3. Heading</h3> <!-- 23px -->
<h4>h4. Heading</h4> <!-- 20px -->
<h5>h5. Heading</h5> <!-- 18px -->
<h6>h6. Heading</h6> <!-- 14px -->
<h1>h1. Heading</h1> <!-- 24px -->
<h2>h2. Heading</h2> <!-- 20px -->
<h3>h3. Heading</h3> <!-- 16px -->
<h4>h4. Heading</h4> <!-- 14px -->
<h5>h5. Heading</h5> <!-- 12px, UPPERCASE -->
<h6>h6. Heading</h6> <!-- 12px -->
{{/example}}

For headings, we're using [sass placeholders](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#placeholder_selectors_) to set the appropriate font size for our headings. If you need to match a heading size with a particular element, you can do so by using `@extend` along with the placeholder name.
Expand Down Expand Up @@ -74,4 +74,4 @@ You can style inline text elements.
<p>This text is <sub>subscript</sub></p>
{{/example}}

test
test
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra text here

30 changes: 20 additions & 10 deletions scss/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ $base-font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "
// Base typography
// ----------------------------------------------

h1,
h1 {
margin: 0;
padding: 0;
font-weight: 700;
}
h2,
h3,
h4,
h5,
h6 {
margin: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Margins and paddings don't need to be repeated since they'll cascade from the initial rule.

Copy link
Author

Choose a reason for hiding this comment

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

I understand what you are saying, but what would be the correct syntax in this example?

Copy link
Contributor

@scurker scurker May 20, 2016

Choose a reason for hiding this comment

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

h1-h6 have the same base margins, so you would want to cascade your changes in rules below the shared rule:

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
  font-weight: 400;
}

h1 {
  font-weight: 700;
}

h5 {
  font-weight: normal;
  text-transform: uppercase;
}

padding: 0;
font-weight: 400;
font-weight: 500;
}

h5 {
margin: 0;
padding: 0;
font-weight: normal;
text-transform: uppercase;
}

body {
Expand All @@ -28,12 +38,12 @@ strong {
}

// Create placeholder selectors
%h1 { font-size: round(2.5 * $base-font-size); } // 35px
%h2 { font-size: round(2 * $base-font-size); } // 28px
%h3 { font-size: round(1.65 * $base-font-size); } // 23px
%h4 { font-size: round(1.42 * $base-font-size); } // 20px
%h5 { font-size: round(1.28 * $base-font-size); } // 18px
%h6 { font-size: round($base-font-size); } // 14px
%h1 { font-size: round(1.72 * $base-font-size); } // 24px
%h2 { font-size: round(1.45 * $base-font-size); } // 20px
%h3 { font-size: round(1.15 * $base-font-size); } // 16px
%h4 { font-size: round($base-font-size); } // 14px
%h5 { font-size: round($base-font-size / 1.2); } // 12px
%h6 { font-size: round($base-font-size / 1.2); } // 12px

h1 { @extend %h1; }
h2 { @extend %h2; }
Expand All @@ -51,4 +61,4 @@ h1 .secondary,
h2 .secondary,
h3 .secondary {
font-weight: 300;
}
}