-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update global EUI font size to use configurable theme units (#7182)
- Loading branch information
Showing
5 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { EuiProvider, EuiProviderProps } from './provider'; | ||
|
||
const meta: Meta<EuiProviderProps<{}>> = { | ||
title: 'EuiProvider', | ||
component: EuiProvider, | ||
argTypes: { | ||
colorMode: { | ||
control: 'select', | ||
options: ['light', 'dark', 'inverse', 'LIGHT', 'DARK', 'INVERSE'], | ||
}, | ||
modify: { control: 'object' }, | ||
componentDefaults: { control: 'object' }, | ||
globalStyles: { control: 'boolean' }, | ||
utilityClasses: { control: 'boolean' }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiProviderProps<{}>>; | ||
|
||
export const FontDefaultUnits: Story = { | ||
render: () => ( | ||
<> | ||
Change <strong>`modify.font.defaultUnits`</strong> to{' '} | ||
<strong>`rem`, `em`, or `px`</strong> and then inspect this demo's `html` | ||
CSS | ||
</> | ||
), | ||
args: { | ||
modify: { font: { defaultUnits: 'rem' } }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**Breaking changes** | ||
|
||
- EUI's global body font-size now respects the `font.defaultUnits` token. This means that the global font size will use the `rem` unit by default, instead of `px`. | ||
|
||
**Accessibility** | ||
|
||
- When using `rem` or `em` font units, EUI now respects, instead of ignoring, browser default font sizes set by end users. |