Skip to content

Commit d12f833

Browse files
committed
overall style adjustments
1 parent 3e36d7b commit d12f833

File tree

11 files changed

+124
-96
lines changed

11 files changed

+124
-96
lines changed

.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { setCustomElements } from '@storybook/web-components';
22
import customElements from '../custom-elements.json';
3-
import '../packages/uui-css/lib/uui-root.css';
3+
import '../packages/uui-css/lib/uui-css.css';
44
import 'https://cdn.skypack.dev/element-internals-polyfill';
55

66
const sort = (a, b) => {

package-lock.json

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/uui-css/lib/custom-properties/sizes.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
--uui-size-space-1: 3px; /*--uui-size-1*/
3939
--uui-size-space-2: 6px; /*--uui-size-2*/
4040
--uui-size-space-3: 12px; /*--uui-size-4*/
41-
--uui-size-space-4: 15px; /*--uui-size-5*/
42-
--uui-size-space-5: 21px; /*--uui-size-7*/
41+
--uui-size-space-4: 18px; /*--uui-size-6*/
42+
--uui-size-space-5: 24px; /*--uui-size-8*/
4343

4444
--uui-size-layout-1: 24px; /*--uui-size-8*/
4545
--uui-size-layout-2: 30px; /*--uui-size-10*/
@@ -59,4 +59,5 @@
5959
--uui-type-h3-size: 30px; /*--uui-size-10*/
6060
--uui-type-h4-size: 21px;
6161
--uui-type-h5-size: var(--uui-type-default-size);
62+
--uui-type-h6-size: var(--uui-type-small-size);
6263
}
Lines changed: 62 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { html } from 'lit-html';
22

33
export default {
4-
title: 'Design/Guidelines',
4+
title: 'Design/Style Guide',
55
};
66

7-
export const LayoutSystem = () => html`
7+
export const Layout = () => html`
88
<article class="uui-root uui-text" style="max-width:580px;">
99
<div
1010
style="display:block; border-bottom: 1px solid var(--uui-color-cocoa-black); padding-top: var(--uui-size-layout-5); margin-bottom:var(--uui-size-layout-3); padding-bottom:var(--uui-size-layout-1);">
11-
<h1>Layout System</h1>
11+
<h1>Layout Style Guide</h1>
1212
<p class="uui-lead">
1313
Following predictable rhythms, will form harmonious arrangements<br />
1414
— ensuring a calm & friendly visual experience.
@@ -24,33 +24,38 @@ export const LayoutSystem = () => html`
2424
2525
<h2>Baseline grid & base unit</h2>
2626
<p>
27-
Baseline grids is a classic layout method, ensuring everything aligns
28-
vertically on line with a certain rhythm. This rhythm will be of same size
29-
as our base-unit, which almost everything in our design will be based
30-
upon.
27+
Baseline grids is a classic layout method, the goal of it is to ensuring
28+
everything aligns vertically to a certain rhythm. This rhythm will be of
29+
same size as our base-unit, which almost everything in our design will be
30+
based upon.
3131
</p>
3232
<p>
33-
We have no creat way of ensuring this in web applications, but we should
34-
try to follow this concept when we design out layouts.
33+
We have no technical ways to ensuring this in a web application, but we
34+
should try to follow this concept when we setup the layout of an
35+
application.
3536
</p>
3637
<blockquote>
3738
You can view the baseline grid at anytime by pressing CTRL + G on your
3839
keyboard.
3940
</blockquote>
4041
<p>
41-
Our base-unit is 6px, providing sizing options of 6, 12, 18, 24, 30, 36,
42-
42, ... This provides a wide variety of sizes kept in a certain system.
42+
Base-unit is 6px, providing sizing options of 6, 12, 18, 24, 30, 36, 42,
43+
... This provides a wide variety of sizes with noticeable difference.
4344
</p>
4445
4546
<h2>Spacing</h2>
4647
<p>
4748
The general rule of spacing is that the space between elements declares
48-
the relation of those. The more related elements are they should stay
49-
closer than ones that are less related. It's not a absolute rule as we can
50-
use other visual elements to indicate separation, like lines and
51-
background color. When using pure space for separation we need to ensure
49+
the relation of those. The more related elements should stay closer than
50+
ones that are less related. It's not a absolute rule as we can use other
51+
visual elements to indicate separation (ex.: a line or different
52+
background colors). When using pure space for separation we need to ensure
5253
the space divided is distinguishable for the eye.
5354
</p>
55+
<blockquote>
56+
The space between elements matters more than getting the size of the
57+
elements right.
58+
</blockquote>
5459
<p>
5560
The layout custom properties provides layout spacing options for most
5661
cases. using this system will ensure layout spacing will be coherent
@@ -68,53 +73,40 @@ export const LayoutSystem = () => html`
6873
</article>
6974
`;
7075

71-
export const TypographyGuideline = () => html`
76+
export const Typography = () => html`
7277
<article class="uui-root uui-text" style="max-width:580px;">
7378
<div
7479
style="display:block; border-bottom: 1px solid var(--uui-color-cocoa-black); padding-top: var(--uui-size-layout-5); margin-bottom:var(--uui-size-layout-3); padding-bottom:var(--uui-size-layout-1);">
75-
<h1>Typography Guide</h1>
80+
<h1>Typography Style Guide</h1>
7681
<p class="uui-lead">
77-
Typography should differentiated enough visually to establish hierarchy.
78-
This hierarchy should provide a visual overview of the textual content.
82+
Typography should differentiate enough to establish a visual hierarchy,
83+
providing orientation points for a calm reading experience.
7984
</p>
8085
<p>
8186
The following guide will take you through the concepts of the Umbraco
82-
Textual Styles. This establishes a common textual reading experience
83-
across sections and implementations.
87+
Typography Styles. This establishes a common textual layouts across
88+
parts and implementations.
8489
</p>
8590
</div>
8691
87-
<h2>Font & Weights</h2>
92+
<h2>Setup</h2>
8893
<p>
89-
The Umbraco font-face is the Google Font: Lato, we have it available in 3
90-
different thicknesses 300 400 and 700.
94+
The Umbraco Typography can be used on a full web application or on a
95+
dedicated spot. To set the font use the <b>uui-root</b> class on the root
96+
element or a element of interest. Additionally the <b>uui-text</b> class
97+
must be set to expose the Umbraco Typography Styles. See the UUI-CSS
98+
package for more.
9199
</p>
92100
93-
<br />
94-
95-
<h2>Headlines</h2>
96-
<p>There is five headline sizings to pick from:</p>
97-
<h5>Headline H5</h5>
98-
<h4>Headline H4</h4>
99-
<h3>Headline H3</h3>
100-
<h2>Headline H2</h2>
101-
<h1>Headline H1</h1>
102-
103-
<br />
104-
105101
<h2>Paragraphs & other elements</h2>
106-
<p>
107-
The default font-size is 15px, for a nice reading experience this conforms
108-
well with a line-height of 24px, which is our base-unit times 4.
102+
<p class="uui-lead">
103+
A lead paragraph can summarize the following text. Lead paragraphs does
104+
not have a corresponding native element, this is solved by applying the
105+
class 'uui-lead' to a &#60;p&#62; element.
109106
</p>
110107
<p>
111-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
112-
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
113-
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
114-
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
115-
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
116-
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
117-
est laborum.
108+
The default font-size is 15px, for a nice reading experience this conforms
109+
well with a line-height of 24px, (base-unit * 4).
118110
</p>
119111
120112
<blockquote>
@@ -123,14 +115,33 @@ export const TypographyGuideline = () => html`
123115
</blockquote>
124116
125117
<p>
126-
Each paragraph is nicely separated, in this way its easier to identify and
127-
relocated after a distraction.
118+
Each &#60;p&#62; tag is nicely separated, in this way its easier to
119+
identify and relocated after a distraction.
128120
</p>
129121
130122
<small>
131-
The small tag can be used for descriptions that cannot take too much
132-
space. The small descriptions use 12px, for a nice reading experience this
133-
conforms well with a line-height of 18px, which is our base-unit times 3.
123+
The &#60;small&#62; tag can be used for descriptions that cannot use too
124+
much space. The small descriptions use 12px, for a nice reading experience
125+
this conforms well with a line-height of 18px, (base-unit * 3).
134126
</small>
127+
128+
<h2>Headlines</h2>
129+
<p>
130+
The headlines can be used via the dedicated native tag or by one of the
131+
equivalent classes. This means that <b>Headline 1</b> can be used used via
132+
<b>&#60;h1&#62;</b> or the class <b>uui-h1</b>.
133+
</p>
134+
<h5>Headline H5</h5>
135+
<h4>Headline H4</h4>
136+
<h3>Headline H3</h3>
137+
<h2>Headline H2</h2>
138+
<h1>Headline H1</h1>
139+
<ul>
140+
<li>&#60;h5&#62; — .uui-h5</li>
141+
<li>&#60;h4&#62; — .uui-h4</li>
142+
<li>&#60;h3&#62; — .uui-h3</li>
143+
<li>&#60;h2&#62; — .uui-h2</li>
144+
<li>&#60;h1&#62; — .uui-h1</li>
145+
</ul>
135146
</article>
136147
`;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
:root {
1+
.uui-root {
22
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
33
font-size: 15px;
4-
line-height: 1.6rem;
4+
line-height: calc(var(--uui-size-2) * 4);
55
-webkit-font-smoothing: antialiased;
66
font-smoothing: antialiased;
77
}
Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
1-
.uui-text h1 {
1+
.uui-text h1,
2+
.uui-text .uui-h1 {
23
font-size: var(--uui-type-h1-size);
34
line-height: var(--uui-size-layout-4);
45
font-weight: 300;
56
margin-left: -5px;
67
margin-top: var(--uui-size-layout-1);
78
margin-bottom: var(--uui-size-layout-1);
89
}
9-
.uui-text p + h1 {
10+
.uui-text p + h1,
11+
.uui-text p + .uui-h1 {
1012
margin-top: var(--uui-size-layout-4);
1113
}
1214

13-
.uui-text h2 {
15+
.uui-text h2,
16+
.uui-text .uui-h2 {
1417
font-size: var(--uui-type-h2-size);
1518
line-height: var(--uui-size-layout-3);
1619
font-weight: 300;
17-
padding-top: 1px;
18-
padding-bottom: 5px;
1920
margin-left: -3px;
2021
margin-top: var(--uui-size-layout-1);
2122
margin-bottom: var(--uui-size-layout-1);
2223
}
23-
.uui-text p + h2 {
24+
.uui-text p + h2,
25+
.uui-text p + .uui-h2 {
2426
margin-top: var(--uui-size-layout-3);
2527
}
2628

27-
.uui-text h3 {
29+
.uui-text h3,
30+
.uui-text .uui-h3 {
2831
font-size: var(--uui-type-h3-size);
2932
line-height: var(--uui-size-large);
3033
font-weight: 300;
31-
padding-top: var(--uui-size-1);
32-
padding-bottom: var(--uui-size-1);
3334
margin-left: -2px;
3435
margin-top: var(--uui-size-layout-1);
3536
margin-bottom: var(--uui-size-layout-1);
3637
}
3738

38-
.uui-text h4 {
39+
.uui-text h4,
40+
.uui-text .uui-h4 {
3941
font-size: var(--uui-type-h4-size);
4042
line-height: 21px;
4143
font-weight: 400;
@@ -44,15 +46,17 @@
4446
margin-bottom: var(--uui-size-layout-1);
4547
}
4648

47-
.uui-text h5 {
49+
.uui-text h5,
50+
.uui-text .uui-h5 {
4851
font-size: var(--uui-type-h5-size);
52+
line-height: inherit;
53+
font-weight: 700;
54+
margin-left: 0;
4955
margin-top: var(--uui-size-layout-1);
5056
margin-bottom: var(--uui-size-layout-1);
5157
}
5258

5359
.uui-text p {
54-
padding-top: var(--uui-size-1);
55-
padding-bottom: var(--uui-size-1);
5660
margin-top: var(--uui-size-layout-1);
5761
margin-bottom: var(--uui-size-layout-1);
5862
}
@@ -62,8 +66,8 @@
6266

6367
.uui-text small {
6468
display: inline-block;
65-
font-size: 12px;
66-
line-height: calc(var(--uui-size-base-unit) * 3);
69+
font-size: var(--uui-type-small-size);
70+
line-height: calc(var(--uui-size-2) * 3);
6771
margin-bottom: var(--uui-size-layout-1);
6872
}
6973

@@ -72,8 +76,6 @@
7276
font-size: 15px;
7377
font-weight: 700;
7478
font-style: italic;
75-
padding-top: var(--uui-size-1);
76-
padding-bottom: var(--uui-size-1);
7779
margin-top: 0;
7880
margin-bottom: var(--uui-size-layout-1);
7981
margin-right: -0.035em;
@@ -84,7 +86,7 @@
8486

8587
.uui-text blockquote:before {
8688
content: open-quote;
87-
margin-left: -0.46em;
89+
margin-left: -0.4em;
8890
margin-right: 0.08em;
8991
vertical-align: bottom;
9092
font-weight: 400;
@@ -93,11 +95,24 @@
9395

9496
.uui-text blockquote:after {
9597
content: close-quote;
96-
margin-left: 0.08em;
97-
margin-right: -0.46em;
98+
margin-left: 0.04em;
99+
margin-right: -0.4em;
98100
vertical-align: bottom;
99101
font-weight: 400;
100102
font-size: 2em;
101103
margin-bottom: -2px;
102104
display: inline-block;
103105
}
106+
107+
.uui-text ul {
108+
list-style-type: square;
109+
padding-left: var(--uui-size-layout-1);
110+
margin-top: var(--uui-size-layout-1);
111+
margin-bottom: var(--uui-size-layout-1);
112+
}
113+
114+
.uui-text ol {
115+
padding-left: var(--uui-size-layout-1);
116+
margin-top: var(--uui-size-layout-1);
117+
margin-bottom: var(--uui-size-layout-1);
118+
}

packages/uui-css/lib/uui-css.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import './custom-properties.css';
2+
@import './typography/lato.css';
3+
@import './typography/uui-root.css';
4+
@import './typography/uui-text.css';

0 commit comments

Comments
 (0)