Put navigation items in the header, and cross tab actions in a footer.
diff --git a/src-docs/src/views/guidelines/button.js b/src-docs/src/views/guidelines/button.js index 8062df8f9c6..65b2d5893ea 100644 --- a/src-docs/src/views/guidelines/button.js +++ b/src-docs/src/views/guidelines/button.js @@ -65,7 +65,7 @@ export default() => (
This button has the heavist visual weight to draw users' attention.
@@ -86,7 +86,7 @@ export default() => (
Such actions include Add and Apply. This button type works well for
@@ -108,7 +108,7 @@ export default() => (
Close, cancel, filter, refresh, and other actions that reconfigure the
@@ -136,7 +136,7 @@ export default() => (
The icon must be immediately understood, for example, a trash can
@@ -253,7 +253,7 @@ export default() => (
- Short and sentence-case, the header should indicate what the modal is about. This task should not require a lot of explanation or user interaction. The primary action is a filled button, and the secondary action is a link button.
Labels should use strong action verbs.
They are the most-commonly used toasts.
@@ -77,7 +77,7 @@ export default () => (
These toasts work well in monitoring apps when something
@@ -101,7 +101,7 @@ export default () => (
An error toast might let users know an action didn't complete or that a form has errors.
@@ -126,7 +126,7 @@ export default () => (
The default toast, an info toast might notify users about an ongoing action.
diff --git a/src-docs/src/views/guidelines/writing.js b/src-docs/src/views/guidelines/writing.js
index ad22a1add09..3e98c097c98 100644
--- a/src-docs/src/views/guidelines/writing.js
+++ b/src-docs/src/views/guidelines/writing.js
@@ -132,12 +132,12 @@ export default () => (
>
From here, you can edit saved objects. To get started, follow these steps.
@@ -352,7 +352,7 @@ export default () => (
@@ -381,7 +381,7 @@ export default () => (
>
diff --git a/src-docs/src/views/steps/heading_element_steps.js b/src-docs/src/views/steps/heading_element_steps.js
index 862e1cb3ee2..4fcd3a475f7 100644
--- a/src-docs/src/views/steps/heading_element_steps.js
+++ b/src-docs/src/views/steps/heading_element_steps.js
@@ -9,7 +9,7 @@ import {
const steps = [
{
title: 'Inspect me',
- children:
Tables can get complicated very fast. If you're just looking for a basic table
@@ -40,7 +39,7 @@ export const TableExample = {
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
-
+
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
Orbiting this at a distance of roughly ninety-two million miles
is an utterly insignificant little blue green planet whose ape-
@@ -40,7 +42,7 @@ const text = [
So it thought the dog was making a poor life choice by focusing so much on mindfulness.
What if its car broke down?
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
This demo shows off
first title
@@ -112,7 +112,7 @@ exports[`EuiSteps renders steps 1`] = `
Step
second title
@@ -134,7 +134,7 @@ exports[`EuiSteps renders steps 1`] = `
Step
third title
@@ -165,7 +165,7 @@ exports[`EuiSteps renders steps with firstStepNumber 1`] = `
Step
first title
@@ -187,7 +187,7 @@ exports[`EuiSteps renders steps with firstStepNumber 1`] = `
Step
second title
@@ -209,7 +209,7 @@ exports[`EuiSteps renders steps with firstStepNumber 1`] = `
Step
third title
diff --git a/src/components/steps/_steps.scss b/src/components/steps/_steps.scss
index 51507fc812d..e0c6f014413 100644
--- a/src/components/steps/_steps.scss
+++ b/src/components/steps/_steps.scss
@@ -11,19 +11,22 @@
.euiTitle {
line-height: $euiStepNumberSize; /* 1 */
}
-}
- .euiStep__title::before {
- content: attr(data-step-num); // Get the number from the data attribute
- @include createStepsNumber();
+ .euiStep__title {
+ font-weight: $euiFontWeightMedium;
+
+ &::before {
+ content: attr(data-step-num); // Get the number from the data attribute
+ @include createStepsNumber();
- margin-right: $euiStepNumberMargin;
- vertical-align: top; /* 1 */
+ margin-right: $euiStepNumberMargin;
+ vertical-align: top; /* 1 */
+ }
}
.euiStep__content {
border-left: $euiBorderThick;
- padding: $euiSize;
+ padding: $euiSize $euiSize $euiSizeXL;
margin: $euiSizeS 0;
// Align the content's contents with the title
@@ -32,5 +35,5 @@
// Align content border to horizontal center of step number
margin-left: ($euiStepNumberSize/2) - 1px;
}
-
+}
diff --git a/src/components/steps/_steps_horizontal.scss b/src/components/steps/_steps_horizontal.scss
index 7106f240fdc..bc1f63d9c60 100644
--- a/src/components/steps/_steps_horizontal.scss
+++ b/src/components/steps/_steps_horizontal.scss
@@ -89,9 +89,9 @@
.euiStepHorizontal__title {
display: block;
- @include euiTitle;
- @include euiFontSize;
+ @include euiTitle("xs");
margin-top: $euiSizeS;
+ font-weight: $euiFontWeightRegular;
// truncate
white-space: nowrap; /* 1 */
diff --git a/src/components/steps/step.js b/src/components/steps/step.js
index 60979961712..162bb32424f 100644
--- a/src/components/steps/step.js
+++ b/src/components/steps/step.js
@@ -27,7 +27,7 @@ export const EuiStep = ({
- Standard buttons are for secondary actions
+ Standard buttons are for secondary actions
- Empty buttons are for complimentary, UI-specific actions
+ Empty buttons are for complimentary, UI-specific actions
- Icon buttons are for saving space
+ Icon buttons are for saving space
The header sets the context
+ The header sets the context
The body is for a single task
+ The body is for a single task
Buttons are right-aligned
+ Buttons are right-aligned
- Success toasts indicate that everything worked out
+ Success toasts indicate that everything worked out
- Warning toasts direct user attention to a potential problem
+ Warning toasts direct user attention to a potential problem
- Error toasts report a problem
+ Error toasts report a problem
- Info toasts relay neutral information
+ Info toasts relay neutral information
Edit saved objects
Edit saved objects
Edit saved objects
+ Edit saved objects
Did you notice the step title is inside a Heading 2 element?
Did you notice the step title is inside a Heading 2 element?
Option 1: If you have this type of instance
+ Option 1: If you have this type of instance
Option 2: If you have the other type of instance
+ Option 2: If you have the other type of instance
This is Heading Four
+
+ This is Heading Five
+
+ This is Heading Six
This is Heading Four
+
+ This is Heading Five
+
+ This is Heading Six
);
diff --git a/src-docs/src/views/text_scaling/text_scaling.js b/src-docs/src/views/text_scaling/text_scaling.js
index a956bdf1e09..010b98093df 100644
--- a/src-docs/src/views/text_scaling/text_scaling.js
+++ b/src-docs/src/views/text_scaling/text_scaling.js
@@ -17,6 +17,8 @@ const text = [
yellow sun.
This is Heading Two
,
+
This is Heading Two
,
+ This is Heading Three
,
This is Heading Three
,
+ This is Heading Four
,
This is Heading Five
,
+
+ This is Heading Six
,
];
export default () => (
@@ -81,7 +94,7 @@ export default () => (
This is a large title
+ This is a large title, only one should exist per page
This is the default size for title
This is a small title
This is an extra small title
+ This is an extra extra small title
+ This is an extra extra extra small title and should only be used when the title is inconsequential (like a label)
+
First step
diff --git a/src/components/steps/__snapshots__/steps.test.js.snap b/src/components/steps/__snapshots__/steps.test.js.snap
index 7f205109681..0bdafa76406 100644
--- a/src/components/steps/__snapshots__/steps.test.js.snap
+++ b/src/components/steps/__snapshots__/steps.test.js.snap
@@ -15,7 +15,7 @@ exports[`EuiSteps renders step title inside "headingElement" element 1`] = `
Step
first title
@@ -37,7 +37,7 @@ exports[`EuiSteps renders step title inside "headingElement" element 1`] = `
Step
second title
@@ -59,7 +59,7 @@ exports[`EuiSteps renders step title inside "headingElement" element 1`] = `
Step
third title
@@ -90,7 +90,7 @@ exports[`EuiSteps renders steps 1`] = `
Step
Title
diff --git a/src/components/title/_title.scss b/src/components/title/_title.scss
index cb2492715b1..30e8a1fcbc8 100644
--- a/src/components/title/_title.scss
+++ b/src/components/title/_title.scss
@@ -1,12 +1,33 @@
.euiTitle {
- @include euiTitle;
- @include euiFontSizeL;
+ + .euiTitle {
+ margin-top: $euiSizeL;
+ }
+}
+
+.euiTitle--uppercase {
+ text-transform: uppercase;
+}
+
+.euiTitle--xxxsmall {
+ @include euiTitle("xxxs");
+}
+
+.euiTitle--xxsmall {
+ @include euiTitle("xxs");
+}
+
+.euiTitle--xsmall {
+ @include euiTitle("xs");
}
.euiTitle--small {
- @include euiFontSizeM;
+ @include euiTitle("s");
+}
+
+.euiTitle--medium {
+ @include euiTitle("m");
}
.euiTitle--large {
- @include euiFontSizeXL;
+ @include euiTitle("l");
}
diff --git a/src/components/title/title.js b/src/components/title/title.js
index e2278a89ce6..eb7375c5307 100644
--- a/src/components/title/title.js
+++ b/src/components/title/title.js
@@ -5,17 +5,28 @@ import classNames from 'classnames';
import PropTypes from 'prop-types';
const titleSizeToClassNameMap = {
+ xxxs: 'euiTitle--xxxsmall',
+ xxs: 'euiTitle--xxsmall',
+ xs: 'euiTitle--xsmall',
s: 'euiTitle--small',
+ m: 'euiTitle--medium',
l: 'euiTitle--large',
};
export const TITLE_SIZES = Object.keys(titleSizeToClassNameMap);
-export const EuiTitle = ({ size, children, className, ...rest }) => {
+const textTransformToClassNameMap = {
+ uppercase: 'euiTitle--uppercase',
+};
+
+export const TEXT_TRANSFORM = Object.keys(textTransformToClassNameMap);
+
+export const EuiTitle = ({ size, children, className, textTransform, ...rest }) => {
const classes = classNames(
'euiTitle',
titleSizeToClassNameMap[size],
+ textTransformToClassNameMap[textTransform],
className
);
@@ -30,5 +41,10 @@ export const EuiTitle = ({ size, children, className, ...rest }) => {
EuiTitle.propTypes = {
children: PropTypes.element.isRequired,
className: PropTypes.string,
- size: PropTypes.oneOf(TITLE_SIZES),
+ size: PropTypes.oneOf(TITLE_SIZES).isRequired,
+ textTransform: PropTypes.oneOf(TEXT_TRANSFORM),
+};
+
+EuiTitle.defaultProps = {
+ size: 'm',
};
diff --git a/src/components/toast/_toast.scss b/src/components/toast/_toast.scss
index 56692266e7d..247b680f5e6 100644
--- a/src/components/toast/_toast.scss
+++ b/src/components/toast/_toast.scss
@@ -69,7 +69,6 @@ $toastTypes: (
* 3. Account for close button.
*/
.euiToastHeader {
- @include euiFontSize;
padding-right: $euiSizeL; /* 3 */
display: flex;
@@ -90,7 +89,7 @@ $toastTypes: (
}
.euiToastHeader__title {
- color: $euiTitleColor;
+ @include euiTitle("s");
font-weight: $euiFontWeightLight;
}
diff --git a/src/global_styling/mixins/_typography.scss b/src/global_styling/mixins/_typography.scss
index 9c1b7a01138..8b0b790384f 100644
--- a/src/global_styling/mixins/_typography.scss
+++ b/src/global_styling/mixins/_typography.scss
@@ -10,23 +10,44 @@
font-family: $euiCodeFontFamily;
}
-@mixin euiTitle {
- color: $euiTitleColor;
- font-weight: $euiFontWeightLight;
-}
-
@mixin euiText {
color: $euiTextColor;
font-weight: $euiFontWeightRegular;
}
-// Font sizing extends, using rem mixin
+@mixin euiTitle($size: "m") {
+ color: $euiTitleColor;
-@mixin euiFontSize {
- @include fontSize($euiFontSize);
- line-height: $euiLineHeight;
+ @if $size == "xxxs" {
+ @include euiFontSizeXS;
+ font-weight: $euiFontWeightBold;
+ @include lineHeightFromBaseline(3);
+ } @else if $size == "xxs" {
+ @include euiFontSizeS;
+ font-weight: $euiFontWeightBold;
+ @include lineHeightFromBaseline(3);
+ } @else if $size == "xs" {
+ @include euiFontSize;
+ font-weight: $euiFontWeightMedium;
+ @include lineHeightFromBaseline(3);
+ } @else if $size == "s" {
+ @include euiFontSizeL;
+ font-weight: $euiFontWeightMedium;
+ @include lineHeightFromBaseline(4);
+ } @else if $size == "m" {
+ @include euiFontSizeXL;
+ @include lineHeightFromBaseline(5);
+ } @else if $size == "l" {
+ @include euiFontSizeXXL;
+ @include lineHeightFromBaseline(6);
+ } @else {
+ @include fontSize($size);
+ @include lineHeightFromBaseline(3);
+ }
}
+// Font sizing extends, using rem mixin
+
@mixin euiFontSizeXS {
@include fontSize($euiFontSizeXS);
line-height: $euiLineHeight;
@@ -54,10 +75,12 @@
@mixin euiFontSizeXL {
@include fontSize($euiFontSizeXL);
- line-height: $euiLineHeight;
+ line-height: 1.25;
+ font-weight: $euiFontWeightLight; // always apply light weight to x-large type
}
@mixin euiFontSizeXXL {
@include fontSize($euiFontSizeXXL);
- line-height: $euiLineHeight;
+ line-height: 1.25;
+ font-weight: $euiFontWeightLight; // always apply light weight to x-large type
}
diff --git a/src/global_styling/variables/_colors.scss b/src/global_styling/variables/_colors.scss
index 3400db5d572..e814dcbf0ac 100644
--- a/src/global_styling/variables/_colors.scss
+++ b/src/global_styling/variables/_colors.scss
@@ -24,7 +24,7 @@ $euiColorSlightHue: #909AA1 !default;
// Every color below must be based mathmatically on the set above.
$euiTextColor: $euiColorDarkestShade !default;
-$euiTitleColor: $euiColorFullShade !default;
+$euiTitleColor: tintOrShade($euiColorFullShade, 10%, 0%) !default;
$euiLinkColor: $euiColorPrimary !default;
$euiFocusBackgroundColor: tintOrShade($euiColorPrimary, 90%, 50%) !default;
diff --git a/src/global_styling/variables/_typography.scss b/src/global_styling/variables/_typography.scss
index 72546c022aa..c33ebfc3c2b 100644
--- a/src/global_styling/variables/_typography.scss
+++ b/src/global_styling/variables/_typography.scss
@@ -16,21 +16,31 @@
font-size: convertToRem($size);
}
+// Our base gridline is at 1/2 the font-size, ensure line-heights stay on that gridline.
+// EX: A proper line-height for text is 1.5 times the font-size.
+// If our base font size (euiFontSize) is 16, our baseline is 8 (16*1.5 / 3). To ensure the
+// text stays on the baseline, we pass a multiplier to calculate a line-height in rems.
+@mixin lineHeightFromBaseline($multiplier: 3) {
+ line-height: convertToRem(($euiFontSize/2)*$multiplier);
+}
+
+
// Families
$euiFontFamily: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$euiCodeFontFamily: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace !default;
-// Font sizes
+// Font sizes -- scale is loosely based on Major Third (1.250)
+$euiTextScale: 2.25, 1.75, 1.25, 1.125, 1, .875, .75;
-$euiFontSize: $euiSize !default;
+$euiFontSize: $euiSize !default; // 5th position in scale
-$euiFontSizeXS: $euiFontSize * .75 !default;
-$euiFontSizeS: $euiFontSize * .875 !default;
-$euiFontSizeM: $euiFontSize * 1.125 !default;
-$euiFontSizeL: $euiFontSize * 1.5 !default;
-$euiFontSizeXL: $euiFontSize * 2 !default;
-$euiFontSizeXXL: $euiFontSize * 3 !default;
+$euiFontSizeXS: $euiFontSize * nth($euiTextScale, 7) !default;
+$euiFontSizeS: $euiFontSize * nth($euiTextScale, 6) !default;
+$euiFontSizeM: $euiFontSize * nth($euiTextScale, 4) !default;
+$euiFontSizeL: $euiFontSize * nth($euiTextScale, 3) !default;
+$euiFontSizeXL: $euiFontSize * nth($euiTextScale, 2) !default;
+$euiFontSizeXXL: $euiFontSize * nth($euiTextScale, 1) !default;
// Line height
diff --git a/src/themes/k6/k6_globals.scss b/src/themes/k6/k6_globals.scss
index e61c08a4107..4ac83328313 100644
--- a/src/themes/k6/k6_globals.scss
+++ b/src/themes/k6/k6_globals.scss
@@ -1,14 +1,16 @@
// Font families
$euiFontFamily: 'Open Sans', Helvetica, Arial, sans-serif;
-// Font Sizes
-$euiFontSize: 14px;
-$euiFontSizeXS: 12px;
-$euiFontSizeS: 14px;
-$euiFontSizeM: 16px;
-$euiFontSizeL: 18px;
-$euiFontSizeXL: 24px;
-$euiFontSizeXXL: 32px;
+$euiTextScale: 2.28571429, 1.71428571, 1.28571429, 1.14285714, 1, 1, 0.85714286;
+
+$euiFontSize: 14px; // 5th position in scale
+
+$euiFontSizeXS: $euiFontSize * nth($euiTextScale, 7); // 12px
+$euiFontSizeS: $euiFontSize * nth($euiTextScale, 6); // 14px
+$euiFontSizeM: $euiFontSize * nth($euiTextScale, 4); // 16px
+$euiFontSizeL: $euiFontSize * nth($euiTextScale, 3); // 18px
+$euiFontSizeXL: $euiFontSize * nth($euiTextScale, 2); // 24px
+$euiFontSizeXXL: $euiFontSize * nth($euiTextScale, 1); // 32px
// Make titles bold.
$euiFontWeightLight: 600;