Skip to content

Commit

Permalink
Added label text
Browse files Browse the repository at this point in the history
  • Loading branch information
dzeng-d2l authored and dlockhart committed Nov 3, 2017
1 parent 26019a1 commit 533f23b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Never used by itself; always in support of another piece of content on the page.

![screenshot of small text](/screenshots/small.png?raw=true)

### Label Text

Used for labels. Its font size/line spacing is relative to the root font
and respond to viewport width changes.

![screenshot of small text](/screenshots/label.png?raw=true)

### Headings

There are four available heading styles. These would typically be applied to the `<h1>`, `<h2>`, `<h3>` and `<h4>` HTML elements, though it's not a requirement.
Expand Down Expand Up @@ -76,6 +83,10 @@ Mixins are also available for standard body, compact body, small body and headin
@include d2l-body-small();
}
.label {
@include d2l-label-text();
}
h1 {
@include d2l-heading-1();
}
Expand Down Expand Up @@ -123,6 +134,9 @@ Additional CSS classes are available for standard body, compact body, small body
<div class="d2l-body-small">
...
</div>
<!-- label text -->
<label class="d2l-label-text">Lorem Ipsum</label>

<!-- compact body -->
<div class="d2l-body-compact">
...
Expand Down
6 changes: 6 additions & 0 deletions d2l-typography-shared-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
margin: 1.5rem 0 1.5rem 0;
};

--d2l-label-text: {
font-size: 0.8rem;
line-height: 1rem;
font-weight: 700;
letter-spacing: 0.2px;
};
}
</style>
</custom-style>
8 changes: 8 additions & 0 deletions d2l-typography.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
@apply --d2l-body-small-text;
}

.d2l-typography .d2l-label-text {
@apply --d2l-label-text;
}

.d2l-typography p,
.vui-typography p {
margin: 1rem 0;
Expand Down Expand Up @@ -130,6 +134,10 @@
font-size: 0.6rem;
line-height: 0.9rem;
}
.d2l-typography .d2l-label-text {
font-size: 0.7rem;
line-height: 0.9rem;
}
}

</style>
Expand Down
13 changes: 13 additions & 0 deletions d2l-typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,16 @@
line-height: 1.2rem;
}
}

@mixin d2l-label-text() {
font-size: 0.8rem;
line-height: 1rem;
font-weight: 700;
letter-spacing: 0.2px;
@media (max-width: 615px) {
font-size: 0.7rem;
line-height: 0.9rem;
font-weight: 700;
letter-spacing: 0.2px;
}
}
6 changes: 6 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ <h4 class="d2l-heading-4">Heading 4</h4>
<p class="d2l-body-small">Grumpy wizards make toxic brew for the evil Queen and Jack. Grumpy wizards make toxic brew for the evil Queen and Jack.</p>
</td>
</tr>
<tr>
<th>Label Text</th>
<td>
<label class="d2l-label-text">Lorem Ipsum</label>
</td>
</tr>
</tbody>
</table>
</body>
Expand Down
Binary file added screenshots/label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 533f23b

Please sign in to comment.