diff --git a/packages/website/docs/components/utilities/css_utility_classes.mdx b/packages/website/docs/components/utilities/css_utility_classes.mdx new file mode 100644 index 00000000000..84b93701e46 --- /dev/null +++ b/packages/website/docs/components/utilities/css_utility_classes.mdx @@ -0,0 +1,186 @@ +--- +slug: /utilities/css-utility-classes +id: utilities_css_utility_classes +--- + +import { Example } from '@site/src/components'; +import { css } from '@emotion/react'; + +import { EuiIcon, EuiMark } from '@elastic/eui'; + +# CSS utility classes + +The following CSS-only classes are provided as helper utilities. They are useful for making micro-adjustments to existing React components. + +:::info Scroll utilities have moved + +For overflow and scrolling specific utilities, go to [the Scroll documentation page](./scroll/overview.mdx). +::: + +:::info Text utilities have moved + +For text and typography specific utilities, go to [the Text documentation page](../theming/typography.mdx). +::: + +:::info Responsive utilities have moved + +For responsive specific utilities, go to [the Breakpoint utilities page](../theming/breakpoints.mdx). +::: + +## Display + + + + ### `eui-displayBlock` className + + Changes the element's display property to `display: block;` + + + Displaying block + + + ```tsx + + /* Your content */ + + ``` + + + + + ### `eui-displayInline` className + + Changes the element's display property to `display: inline;` + + + Displaying inline + + + ```tsx +
+ /* Your content */ +
+ ``` +
+
+ + + ### `eui-displayInlineBlock` className + + Changes the element's display property to `display: inline-block;` + + + Displaying inline block + + + ```tsx + + /* Your content */ + + ``` + + + + + ### `eui-fullWidth` className + + Changes the element's display property to `display: inline-block;` and adds `width: 100%;` + + + Displaying full width + + + ```tsx + + /* Your content */ + + ``` + + + +## Vertical alignment + + + + ### `eui-alignTop` className + + Changes the element's vertical alignment property to `vertical-align: top;` + + +

+ Icon is aligned to the top of the text +

+
+ + ```tsx + + ``` + +
+ + + ### `eui-alignMiddle` className + + Changes the element's vertical alignment property to `vertical-align: middle;` + + +

+ Icon is aligned to the middle of the text +

+
+ + ```tsx + + ``` + +
+ + + ### `eui-alignBottom` className + + Changes the element's vertical alignment property to `vertical-align: bottom;` + + +

+ Icon is aligned to the bottom of the text +

+
+ + ```tsx + + ``` + +
+ + + ### `eui-alignBaseline` className + + Changes the element's vertical alignment property to `vertical-align: baseline;` + + +

+ Icon is aligned to the baseline of the text +

+
+ + ```tsx + + ``` + +