Skip to content

Commit

Permalink
feat(typography): Reverted baseline mixin to use display inline-block…
Browse files Browse the repository at this point in the history
… because of IE issues (#3297)

BREAKING CHANGE: Helper text and MDC List two-line text that uses new typography baseline mixin should strip the white-space.
  • Loading branch information
abhiomkar authored Aug 3, 2018
1 parent edf3823 commit ded07d0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
20 changes: 10 additions & 10 deletions demos/text-field.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h2>Full Functionality JS Component (Floating Label, Validation)</h2>
<div class="mdc-line-ripple"></div>
</div>
<p id="my-text-field-helper-text" class="mdc-text-field-helper-text"
aria-hidden="true" style="visibility: hidden">
Helper Text (possibly validation message)
aria-hidden="true" style="visibility: hidden"
>Helper Text (possibly validation message)
</p>
</section>
<div>
Expand Down Expand Up @@ -131,8 +131,8 @@ <h2>Password field with validation</h2>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg"
id="pw-validation-msg">
Must be at least 8 characters long
id="pw-validation-msg"
>Must be at least 8 characters long
</p>
</section>

Expand All @@ -152,8 +152,8 @@ <h2>Outlined Text Field</h2>
<div class="mdc-notched-outline__idle"></div>
</div>
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg"
id="name-validation-message">
Helper Text (possibly validation message)
id="name-validation-message"
>Helper Text (possibly validation message)
</p>
</div>
<div>
Expand Down Expand Up @@ -197,8 +197,8 @@ <h2>Text Field box</h2>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text"
id="box-name-validation-message" style="visibility: hidden">
Helper Text (possibly validation message)
id="box-name-validation-message" style="visibility: hidden"
>Helper Text (possibly validation message)
</p>
</div>
<div>
Expand Down Expand Up @@ -394,8 +394,8 @@ <h2>Custom error state behaviour - remove error state as soon as invalid input i
<label class="mdc-floating-label" for="demo-textfield-error-state-input">Phone number</label>
<div class="mdc-line-ripple"></div>
</div>
<p id="username-helper-text" class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg" aria-hidden="true">
Enter 10 digit phone number including area code
<p id="username-helper-text" class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg" aria-hidden="true"
>Enter 10 digit phone number including area code
</p>
</section>
</section>
Expand Down
13 changes: 3 additions & 10 deletions demos/typography.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,9 @@ <h6 class="mdc-typography--subtitle2">Subtitle 2</h6>

<h6 class="mdc-typography--headline6 demo-typography--heading-baseline">Baseline</h6>
<section class="demo-typography--section-baseline">
<h2 class="demo-typography__title mdc-typography--headline6">
Our Changing Planet
</h2>
<h3 class="demo-typography__subtitle mdc-typography--subtitle2">
by Kurt Wagner
</h3>
<div class="demo-typography__body mdc-typography--body2">
Visit ten places on our planet that are undergoing the biggest changes today.
</div>

<h2 class="demo-typography__title mdc-typography--headline6">Our Changing Planet</h2>
<h3 class="demo-typography__subtitle mdc-typography--subtitle2">by Kurt Wagner</h3>
<div class="demo-typography__body mdc-typography--body2">Visit ten places on our planet that are undergoing the biggest changes today.</div>
<line class="demo-typography-line-1">+34px</line>
<line class="demo-typography-line-2">+22px</line>
<line class="demo-typography-line-3">+28px</line>
Expand Down
2 changes: 2 additions & 0 deletions packages/mdc-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ in the double line list style as defined by
</ul>
```

> NOTE: Make sure there are no white-space characters before primary and secondary text content.
### List Groups

Multiple related lists can be grouped together using the `mdc-list-group` class on a containing element.
Expand Down
2 changes: 2 additions & 0 deletions packages/mdc-textfield/helper-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Helper text gives context about a field’s input, such as how the input will be
<p class="mdc-text-field-helper-text" aria-hidden="true">
```

> NOTE: Make sure there are no white-space characters before helper text content.
### Styles

```scss
Expand Down
9 changes: 5 additions & 4 deletions packages/mdc-typography/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@
}

@mixin mdc-typography-baseline-top($distance) {
display: flex;
align-items: baseline;
display: block;
margin-top: 0;
line-height: normal;

&::before {
@include mdc-typography-baseline-strut_($distance);

vertical-align: 0;
}
}

Expand All @@ -58,12 +59,12 @@
&::after {
@include mdc-typography-baseline-strut_($distance);

align-items: flex-start;
vertical-align: -1 * $distance;
}
}

@mixin mdc-typography-baseline-strut_($distance) {
display: inline-flex;
display: inline-block;
width: 0;
height: $distance;
content: "";
Expand Down

0 comments on commit ded07d0

Please sign in to comment.