- Accent color
+ brand color
diff --git a/packages/react-examples/src/react-button/CompoundButton/CompoundButton.stories.tsx b/packages/react-examples/src/react-button/CompoundButton/CompoundButton.stories.tsx
index cc705eb14a64b..a49e51d4e2c02 100644
--- a/packages/react-examples/src/react-button/CompoundButton/CompoundButton.stories.tsx
+++ b/packages/react-examples/src/react-button/CompoundButton/CompoundButton.stories.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { CompoundButton, CompoundButtonProps } from '@fluentui/react-button';
-import * as classes from '../utils/Button.stories.scss';
+import * as classes from '../Button.stories.scss';
/**
* Temporary Stack until there's one in its own package.
@@ -17,82 +17,63 @@ const Stack = (props: React.PropsWithChildren<{ horizontal?: boolean }>) => {
// eslint-disable-next-line jsx-a11y/heading-has-content -- content passed via children
const Text = (props: React.PropsWithChildren<{}>) => ;
-const CompoundButtonVariants = (props: CompoundButtonProps) => (
+const CompoundButtonExamples = (props: CompoundButtonProps) => (
Hello, world
-
+
Hello, world
-
+
Hello, world
-
+
Hello, world
-
+
Hello, world
-
+
Hello, world
);
-export const CompoundButtonCss = () => (
+export const CompoundButtons = () => (
A CompoundButton comes in default and `primary` flavors.
-
+
A CompoundButton can appear round using the `circular` prop.
-
+
A CompoundButton can fill the width of its container using the `fluid` prop.
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
+
A CompoundButton can contain only an icon using the `iconOnly` prop.
-
+
A CompoundButton can be both `circular` and `iconOnly`.
-
+
An icon CompoundButton can format its Icon to appear before or after its content.
-
-
+
+
A CompoundButton can show a loading indicator using the `loading` prop.
-
+
A CompoundButton can be sized.
-
-
-
-
-
-
+
+
+
+
+
+
);
diff --git a/packages/react-examples/src/react-button/MenuButton/MenuButton.stories.tsx b/packages/react-examples/src/react-button/MenuButton/MenuButton.stories.tsx
index 2ad8c2d884e5a..db6b7fc14f3ff 100644
--- a/packages/react-examples/src/react-button/MenuButton/MenuButton.stories.tsx
+++ b/packages/react-examples/src/react-button/MenuButton/MenuButton.stories.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { MenuButton, MenuButtonProps } from '@fluentui/react-button';
import { ContextualMenu, IContextualMenuProps, Stack, Text } from 'office-ui-fabric-react';
-import * as classes from '../utils/Button.stories.scss';
+import * as classes from '../Button.stories.scss';
const menuProps = {
items: [
@@ -20,15 +20,15 @@ const Menu = (defaultSlotType: string, props: IContextualMenuProps) => {
return ;
};
-const MenuButtonVariants = (props: MenuButtonProps) => (
+const MenuButtonExamples = (props: MenuButtonProps) => (
Hello, world
-
+
Hello, world
-
+
Hello, world
@@ -43,53 +43,36 @@ const MenuButtonVariants = (props: MenuButtonProps) => (
);
-export const MenuButtonCss = () => (
+export const MenuButtons = () => (
A button comes in default and `primary` flavors.
-
+
A button can appear round using the `circular` prop.
-
+
A button can fill the width of its container using the `fluid` prop.
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
+
A button can contain only an icon using the `iconOnly` prop.
-
+
A button can be both `circular` and `iconOnly`.
-
+
A button can show a loading indicator using the `loading` prop.
-
+
A button can be sized.
-
-
-
-
-
-
+
+
+
+
+
+
);
diff --git a/packages/react-examples/src/react-button/SplitButton/SplitButton.stories.tsx b/packages/react-examples/src/react-button/SplitButton/SplitButton.stories.tsx
index fb70346ea0169..fc24b3dbeebda 100644
--- a/packages/react-examples/src/react-button/SplitButton/SplitButton.stories.tsx
+++ b/packages/react-examples/src/react-button/SplitButton/SplitButton.stories.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { SplitButton, SplitButtonProps } from '@fluentui/react-button';
import { Stack, Text } from 'office-ui-fabric-react';
-import * as classes from '../utils/Button.stories.scss';
+import * as classes from '../Button.stories.scss';
const menuProps = {
items: [
@@ -16,15 +16,15 @@ const menuProps = {
],
};
-const SplitButtonVariants = (props: SplitButtonProps) => (
+const SplitButtonExamples = (props: SplitButtonProps) => (
Hello, world
-
+
Hello, world
-
+
Hello, world
@@ -39,53 +39,34 @@ const SplitButtonVariants = (props: SplitButtonProps) => (
);
-export const SplitButtonCss = () => (
+export const SplitButtons = () => (
A split button comes in default and `primary` variant.
-
+
A split button can appear round using the `circular` prop.
-
+
A split button can fill the width of its container using the `fluid` prop.
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
+
A split button can contain only an icon using the `iconOnly` prop.
-
+
A split button can be both `circular` and `iconOnly`.
-
+
A split button can show a loading indicator using the `loading` prop.
-
+
A split button can be sized.
-
-
-
-
-
-
+
+
+
+
+
+
);
diff --git a/packages/react-examples/src/react-button/ToggleButton/ToggleButton.stories.tsx b/packages/react-examples/src/react-button/ToggleButton/ToggleButton.stories.tsx
index eeded2dc6954b..2e834849cabde 100644
--- a/packages/react-examples/src/react-button/ToggleButton/ToggleButton.stories.tsx
+++ b/packages/react-examples/src/react-button/ToggleButton/ToggleButton.stories.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import { ToggleButton, ToggleButtonProps } from '@fluentui/react-button';
import { Stack, Text } from 'office-ui-fabric-react';
-import * as classes from '../utils/Button.stories.scss';
+import * as classes from '../Button.stories.scss';
-const ToggleButtonVariants = (props: ToggleButtonProps) => (
+const ToggleButtonExamples = (props: ToggleButtonProps) => (
Hello, world
-
+
Hello, world
-
+
Hello, world
@@ -26,59 +26,42 @@ const ToggleButtonVariants = (props: ToggleButtonProps) => (
);
-export const ToggleButtonCss = () => (
+export const ToggleButtons = () => (
A button comes in default and `primary` flavors.
-
+
A button can appear round using the `circular` prop.
-
+
A button can fill the width of its container using the `fluid` prop.
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
-
- Hello, world
-
+
A button can contain only an icon using the `iconOnly` prop.
-
+
A button can be both `circular` and `iconOnly`.
-
+
An icon button can format its Icon to appear before or after its content.
-
-
+
+
A button can show a loading indicator using the `loading` prop.
-
+
A button can be sized.
-
-
-
-
-
-
+
+
+
+
+
+
);
diff --git a/packages/react-theme-provider/etc/react-theme-provider.api.md b/packages/react-theme-provider/etc/react-theme-provider.api.md
index d2ea9c664dfab..a6459b008ea87 100644
--- a/packages/react-theme-provider/etc/react-theme-provider.api.md
+++ b/packages/react-theme-provider/etc/react-theme-provider.api.md
@@ -6,6 +6,7 @@
import { ColorTokenSet } from '@fluentui/theme';
import { ComponentProps } from '@fluentui/react-compose/lib/next/index';
+import { ICustomizerContext } from '@uifabric/utilities';
import { IFontFace } from '@uifabric/merge-styles';
import { IKeyframes } from '@uifabric/merge-styles';
import { IRawFontStyle } from '@uifabric/merge-styles';
@@ -16,6 +17,7 @@ import { PartialTheme } from '@fluentui/theme';
import * as React from 'react';
import { Theme } from '@fluentui/theme';
import { TokenSetType } from '@fluentui/theme';
+import { Variants } from '@fluentui/theme';
// @public
export const createDefaultTheme: () => Theme;
@@ -50,6 +52,17 @@ export function makeStyles(options: MakeVariantClassesOptions) => (state: TState, theme?: Theme | undefined, renderer?: import(".").StyleRenderer | undefined) => void;
+
+// @public
+export type MakeVariantClassesOptions = {
+ name?: string;
+ prefix?: string;
+ styles?: Record | ((theme: Theme) => Record);
+ variants?: Variants | ((theme: Theme) => Variants);
+};
+
// @public (undocumented)
export const MergeStylesProvider: ({ children }: {
children?: React.ReactNode;
@@ -90,7 +103,7 @@ export const StyleRendererContext: React.Context;
// @public (undocumented)
export type StyleRendererOptions = {
- rtl: boolean;
+ rtl?: boolean;
targetWindow: Window | undefined;
};
@@ -116,10 +129,11 @@ export interface ThemeProviderProps extends ComponentProps, React.HTMLAttributes
// @public
export type ThemeProviderState = Omit & {
theme: Theme;
+ customizerContext: ICustomizerContext;
};
// @public (undocumented)
-export const tokensToStyleObject: (tokens?: TokenSetType | undefined, prefix?: string | undefined, style?: React.CSSProperties | undefined) => React.CSSProperties;
+export const tokensToStyleObject: (tokens?: React.CSSProperties | TokenSetType | undefined, prefix?: string | undefined, style?: React.CSSProperties | undefined) => React.CSSProperties;
// @public
export const useInlineTokens: (draftState: {
@@ -145,6 +159,9 @@ export function useThemeProviderClasses(state: ThemeProviderState): void;
// @public (undocumented)
export const useThemeProviderState: (draftState: ThemeProviderState) => void;
+// @public (undocumented)
+export const withThemeProvider: (Component: React.FunctionComponent) => React.ForwardRefExoticComponent & React.RefAttributes>;
+
// (No @packageDocumentation comment for this package)
diff --git a/packages/react-theme-provider/src/ThemeProvider.test.tsx b/packages/react-theme-provider/src/ThemeProvider.test.tsx
index 964e4127303be..c853ea1e3f15a 100644
--- a/packages/react-theme-provider/src/ThemeProvider.test.tsx
+++ b/packages/react-theme-provider/src/ThemeProvider.test.tsx
@@ -7,6 +7,7 @@ import { mount } from 'enzyme';
import { mergeThemes } from '@fluentui/theme';
import { createDefaultTheme } from './createDefaultTheme';
import { Stylesheet } from '@uifabric/merge-styles';
+import { getTokens } from './getTokens';
const lightTheme = mergeThemes({
stylesheets: [],
@@ -90,7 +91,10 @@ describe('ThemeProvider', () => {
,
);
- const expectedTheme = mergeThemes(createDefaultTheme(), lightTheme);
+ const expectedTheme: Theme = mergeThemes(createDefaultTheme(), lightTheme);
+ expectedTheme.tokens = getTokens(expectedTheme);
+ expectedTheme.id = '0-0';
+
expect(resolvedTheme).toEqual(expectedTheme);
});
diff --git a/packages/react-theme-provider/src/ThemeProvider.tsx b/packages/react-theme-provider/src/ThemeProvider.tsx
index a6a1abdb3b951..d5378898ce446 100644
--- a/packages/react-theme-provider/src/ThemeProvider.tsx
+++ b/packages/react-theme-provider/src/ThemeProvider.tsx
@@ -24,6 +24,7 @@ export const ThemeProvider = React.forwardRef & {
theme: Theme;
+
+ customizerContext: ICustomizerContext;
};
diff --git a/packages/react-theme-provider/src/__snapshots__/ThemeProvider.test.tsx.snap b/packages/react-theme-provider/src/__snapshots__/ThemeProvider.test.tsx.snap
index 23efa4836d573..d28e1c88e081f 100644
--- a/packages/react-theme-provider/src/__snapshots__/ThemeProvider.test.tsx.snap
+++ b/packages/react-theme-provider/src/__snapshots__/ThemeProvider.test.tsx.snap
@@ -10,146 +10,6 @@ exports[`ThemeProvider can apply body theme to body 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: black;
--color-body-contentColor: white;
--color-brand-background: #0078d4;
@@ -182,42 +42,6 @@ exports[`ThemeProvider can apply body theme to body 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
@@ -241,146 +65,6 @@ exports[`ThemeProvider can apply body theme to body 2`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: black;
--color-body-contentColor: white;
--color-brand-background: #0078d4;
@@ -413,42 +97,6 @@ exports[`ThemeProvider can apply body theme to body 2`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
>
app
@@ -465,146 +113,6 @@ exports[`ThemeProvider can apply body theme to none 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: black;
--color-body-contentColor: white;
--color-brand-background: #0078d4;
@@ -637,42 +145,6 @@ exports[`ThemeProvider can apply body theme to none 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
>
app
@@ -689,146 +161,6 @@ exports[`ThemeProvider can handle a partial theme 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: #ffffff;
--color-body-contentColor: #323130;
--color-brand-background: #0078d4;
@@ -862,42 +194,6 @@ exports[`ThemeProvider can handle a partial theme 1`] = `
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
--foo-background: red;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
@@ -923,146 +219,6 @@ exports[`ThemeProvider renders a div 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: #ffffff;
--color-body-contentColor: #323130;
--color-brand-background: #0078d4;
@@ -1095,42 +251,6 @@ exports[`ThemeProvider renders a div 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
@@ -1156,146 +276,6 @@ exports[`ThemeProvider renders a div with styling 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: white;
--color-body-contentColor: black;
--color-brand-background: #0078d4;
@@ -1328,42 +308,6 @@ exports[`ThemeProvider renders a div with styling 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
@@ -1389,146 +333,6 @@ exports[`ThemeProvider renders nested themes 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: white;
--color-body-contentColor: black;
--color-brand-background: #0078d4;
@@ -1561,42 +365,6 @@ exports[`ThemeProvider renders nested themes 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
@@ -1620,146 +388,6 @@ exports[`ThemeProvider renders nested themes 1`] = `
--body-fontWeight: 400;
--body-mozOsxFontSmoothing: grayscale;
--body-webkitFontSmoothing: antialiased;
- --button-background: #ffffff;
- --button-borderColor: #8a8886;
- --button-borderRadius: 2px;
- --button-borderWidth: 1px;
- --button-checked-background: #edebe9;
- --button-checked-contentColor: #201f1e;
- --button-checkedHovered-background: #edebe9;
- --button-checkedHovered-contentColor: #000000;
- --button-contentColor: #323130;
- --button-contentGap: 8px;
- --button-disabled-background: #f3f2f1;
- --button-disabled-borderColor: #f3f2f1;
- --button-disabled-contentColor: #a19f9d;
- --button-disabled-iconColor: var(--button-disabled-contentColor);
- --button-disabled-secondaryContentColor: #a19f9d;
- --button-dividerColor: #c8c6c4;
- --button-dividerThickness: var(--button-borderWidth);
- --button-focusColor: #000000;
- --button-focusInnerColor: #ffffff;
- --button-focusWidth: 2px;
- --button-focused-background: var(--button-background);
- --button-focused-borderColor: var(--button-borderColor);
- --button-focused-contentColor: var(--button-contentColor);
- --button-focused-iconColor: var(--button-iconColor);
- --button-focused-menuIconColor: var(--button-menuIconColor);
- --button-focused-secondaryContentColor: var(--button-focused-contentColor);
- --button-fontFamily: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
- --button-fontSize: 14px;
- --button-fontWeight: 600;
- --button-height: var(--button-size-regular);
- --button-hovered-background: #f3f2f1;
- --button-hovered-borderColor: #8a8886;
- --button-hovered-contentColor: #201f1e;
- --button-hovered-iconColor: var(--button-iconColor);
- --button-hovered-menuIconColor: var(--button-menuIconColor);
- --button-hovered-secondaryContentColor: #201f1e;
- --button-iconColor: inherit;
- --button-iconSize: 16px;
- --button-innerFocusWidth: 2px;
- --button-menuIconColor: inherit;
- --button-menuIconSize: 12px;
- --button-minHeight: var(--button-size-regular);
- --button-paddingBottom: 0;
- --button-paddingLeft: 20px;
- --button-paddingRight: 20px;
- --button-paddingTop: 0;
- --button-pressed-background: #edebe9;
- --button-pressed-borderColor: #8a8886;
- --button-pressed-contentColor: #201f1e;
- --button-pressed-iconColor: var(--button-iconColor);
- --button-pressed-menuIconColor: var(--button-menuIconColor);
- --button-pressed-secondaryContentColor: #201f1e;
- --button-secondaryContentColor: #605e5c;
- --button-secondaryContentFontSize: 12px;
- --button-secondaryContentFontWeight: normal;
- --button-secondaryContentMarginTop: 5px;
- --button-size-large: 40px;
- --button-size-larger: 48px;
- --button-size-largest: 64px;
- --button-size-regular: 32px;
- --button-size-small: 24px;
- --button-size-smaller: 24px;
- --button-size-smallest: 24px;
- --card-backgroundColor: #ffffff;
- --card-borderColor: transparent;
- --card-borderRadius: var(--card-size-medium-borderRadius);
- --card-borderWidth: 1px;
- --card-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-backgroundColor: #ffffff;
- --card-clickable-borderColor: transparent;
- --card-clickable-borderWidth: 1px;
- --card-clickable-boxShadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-hovered-backgroundColor: #fafafa;
- --card-clickable-hovered-borderColor: var(--card-clickable-borderColor);
- --card-clickable-hovered-borderWidth: var(--card-clickable-borderWidth);
- --card-clickable-hovered-boxShadow: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1);
- --card-clickable-pressed-backgroundColor: #f5f5f5;
- --card-clickable-pressed-borderColor: var(--card-clickable-borderColor);
- --card-clickable-pressed-borderWidth: 2px;
- --card-clickable-pressed-boxShadow: var(--card-clickable-boxShadow);
- --card-compact-padding: 0;
- --card-disabled-backgroundColor: #f0f0f0;
- --card-disabled-borderColor: var(--card-borderColor);
- --card-disabled-borderWidth: var(--card-borderWidth);
- --card-disabled-boxShadow: 0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1);
- --card-fluid-height: 100%;
- --card-fluid-width: 100%;
- --card-height: var(--card-size-medium-height);
- --card-hovered-backgroundColor: var(--card-backgroundColor);
- --card-hovered-borderColor: var(--card-borderColor);
- --card-hovered-borderWidth: var(--card-borderWidth);
- --card-hovered-boxShadow: var(--card-boxShadow);
- --card-margin: var(--card-size-medium-margin);
- --card-minHeight: 32px;
- --card-minWidth: 100px;
- --card-padding: var(--card-size-medium-padding);
- --card-pressed-backgroundColor: var(--card-backgroundColor);
- --card-pressed-borderColor: var(--card-borderColor);
- --card-pressed-borderWidth: var(--card-borderWidth);
- --card-pressed-boxShadow: var(--card-boxShadow);
- --card-selected-backgroundColor: #fafafa;
- --card-selected-borderColor: var(--card-borderColor);
- --card-selected-borderWidth: var(--card-borderWidth);
- --card-selected-boxShadow: var(--card-boxShadow);
- --card-size-large-borderRadius: 6px;
- --card-size-large-height: auto;
- --card-size-large-margin: 0;
- --card-size-large-padding: 16px;
- --card-size-large-width: auto;
- --card-size-larger-borderRadius: 6px;
- --card-size-larger-height: auto;
- --card-size-larger-margin: 0;
- --card-size-larger-padding: 16px;
- --card-size-larger-width: auto;
- --card-size-largest-borderRadius: 6px;
- --card-size-largest-height: auto;
- --card-size-largest-margin: 0;
- --card-size-largest-padding: 16px;
- --card-size-largest-width: auto;
- --card-size-medium-borderRadius: 4px;
- --card-size-medium-height: auto;
- --card-size-medium-margin: 0;
- --card-size-medium-padding: 16px;
- --card-size-medium-width: auto;
- --card-size-small-borderRadius: 4px;
- --card-size-small-height: auto;
- --card-size-small-margin: 0;
- --card-size-small-padding: 8px;
- --card-size-small-width: auto;
- --card-size-smaller-borderRadius: 4px;
- --card-size-smaller-height: auto;
- --card-size-smaller-margin: 0;
- --card-size-smaller-padding: 8px;
- --card-size-smaller-width: auto;
- --card-size-smallest-borderRadius: 4px;
- --card-size-smallest-height: auto;
- --card-size-smallest-margin: 0;
- --card-size-smallest-padding: 8px;
- --card-size-smallest-width: auto;
- --card-width: var(--card-size-medium-width);
--color-body-background: black;
--color-body-contentColor: white;
--color-brand-background: #0078d4;
@@ -1792,42 +420,6 @@ exports[`ThemeProvider renders nested themes 1`] = `
--color-brand-pressed-iconColor: var(--color-brand-iconColor);
--color-brand-pressed-secondaryContentColor: #ffffff;
--color-brand-secondaryContentColor: #ffffff;
- --ghost-background: transparent;
- --ghost-borderColor: transparent;
- --ghost-checked-background: #edebe9;
- --ghost-checked-borderColor: var(--ghost-borderColor);
- --ghost-checked-contentColor: #000000;
- --ghost-checked-iconColor: #004578;
- --ghost-checkedHovered-background: #e1dfdd;
- --ghost-checkedHovered-borderColor: var(--ghost-borderColor);
- --ghost-checkedHovered-contentColor: #0078d4;
- --ghost-checkedHovered-iconColor: #0078d4;
- --ghost-contentColor: #323130;
- --ghost-disabled-background: #f3f2f1;
- --ghost-disabled-borderColor: var(--ghost-borderColor);
- --ghost-disabled-contentColor: #a19f9d;
- --ghost-disabled-iconColor: inherit;
- --ghost-disabled-secondaryContentColor: #a19f9d;
- --ghost-expanded-contentColor: #0078d4;
- --ghost-focused-background: var(--ghost-background);
- --ghost-focused-borderColor: var(--ghost-borderColor);
- --ghost-focused-contentColor: #323130;
- --ghost-focused-iconColor: #106ebe;
- --ghost-focused-secondaryContentColor: #323130;
- --ghost-fontWeight: normal;
- --ghost-hovered-background: #f3f2f1;
- --ghost-hovered-borderColor: var(--ghost-borderColor);
- --ghost-hovered-contentColor: #0078d4;
- --ghost-hovered-iconColor: #0078d4;
- --ghost-hovered-secondaryContentColor: #0078d4;
- --ghost-iconColor: #106ebe;
- --ghost-menuIconColor: #605e5c;
- --ghost-pressed-background: #edebe9;
- --ghost-pressed-borderColor: var(--ghost-borderColor);
- --ghost-pressed-contentColor: #000000;
- --ghost-pressed-iconColor: #004578;
- --ghost-pressed-secondaryContentColor: #000000;
- --ghost-secondaryContentColor: #323130;
}
{
-moz-osx-font-smoothing: var(--body-mozOsxFontSmoothing);
diff --git a/packages/react-theme-provider/src/getTokens.ts b/packages/react-theme-provider/src/getTokens.ts
index 2a565be40bde4..3ba3bcf3aee36 100644
--- a/packages/react-theme-provider/src/getTokens.ts
+++ b/packages/react-theme-provider/src/getTokens.ts
@@ -5,8 +5,8 @@ import { merge } from '@uifabric/utilities';
* Get tokens from theme object.
*/
export function getTokens(theme: Theme): Tokens {
- const { tokens } = theme;
- const { fonts, effects, palette, semanticColors } = theme;
+ const { tokens, fonts } = theme;
+ const { palette, semanticColors } = theme;
const preparedTokens: Tokens = merge(
{
@@ -76,286 +76,8 @@ export function getTokens(theme: Theme): Tokens {
mozOsxFontSmoothing: fonts.medium.MozOsxFontSmoothing,
webkitFontSmoothing: fonts.medium.WebkitFontSmoothing,
},
-
- // TODO: This will be moved out as a button variant.
- ghost: {
- contentColor: palette.neutralPrimary,
- iconColor: palette.themeDarkAlt,
- menuIconColor: palette.neutralSecondary,
- secondaryContentColor: palette.neutralPrimary,
- fontWeight: 'normal',
- background: 'transparent',
- borderColor: 'transparent',
-
- checked: {
- background: palette.neutralLight,
- contentColor: palette.black,
- iconColor: palette.themeDarker,
- borderColor: 'var(--ghost-borderColor)',
- },
-
- checkedHovered: {
- background: palette.neutralQuaternaryAlt,
- contentColor: palette.themePrimary,
- iconColor: palette.themePrimary,
- borderColor: 'var(--ghost-borderColor)',
- },
-
- disabled: {
- contentColor: palette.neutralTertiary,
- iconColor: 'inherit',
- background: semanticColors.disabledBackground,
- borderColor: 'var(--ghost-borderColor)',
- secondaryContentColor: palette.neutralTertiary,
- },
-
- expanded: {
- contentColor: palette.themePrimary,
- },
-
- focused: {
- contentColor: palette.neutralPrimary,
- iconColor: palette.themeDarkAlt,
- secondaryContentColor: palette.neutralPrimary,
- background: 'var(--ghost-background)',
- borderColor: 'var(--ghost-borderColor)',
- },
-
- hovered: {
- background: palette.neutralLighter,
- contentColor: palette.themePrimary,
- iconColor: palette.themePrimary,
- secondaryContentColor: palette.themePrimary,
- borderColor: 'var(--ghost-borderColor)',
- },
-
- pressed: {
- background: palette.neutralLight,
- contentColor: palette.black,
- iconColor: palette.themeDarker,
- secondaryContentColor: palette.black,
- borderColor: 'var(--ghost-borderColor)',
- },
- },
-
- // TODO: This will be moved out as a button variant.
- button: {
- fontWeight: '600',
- fontSize: fonts.medium.fontSize,
- fontFamily: fonts.medium.fontFamily,
- iconSize: fonts.mediumPlus.fontSize,
- borderRadius: effects.roundedCorner2,
- focusColor: palette.black,
- focusInnerColor: palette.white,
-
- background: semanticColors.buttonBackground,
- borderColor: semanticColors.buttonBorder,
- contentColor: semanticColors.buttonText,
- dividerColor: palette.neutralTertiaryAlt,
-
- secondaryContentColor: palette.neutralSecondary,
- secondaryContentFontSize: fonts.small.fontSize,
-
- paddingLeft: '20px',
- paddingRight: '20px',
- paddingTop: '0',
- paddingBottom: '0',
- height: 'var(--button-size-regular)',
- minHeight: 'var(--button-size-regular)',
- contentGap: '8px',
- borderWidth: '1px',
- focusWidth: '2px',
- innerFocusWidth: '2px',
- iconColor: 'inherit',
- menuIconColor: 'inherit',
- menuIconSize: '12px',
- dividerThickness: 'var(--button-borderWidth)',
- secondaryContentFontWeight: 'normal',
- secondaryContentMarginTop: '5px',
-
- size: {
- // smallest size supported by default theme is 24px.
- smallest: '24px',
- smaller: '24px',
- small: '24px',
- regular: '32px',
- large: '40px',
- larger: '48px',
- largest: '64px',
- },
-
- hovered: {
- background: semanticColors.buttonBackgroundHovered,
- borderColor: semanticColors.buttonBorder,
- contentColor: semanticColors.buttonTextHovered,
- secondaryContentColor: palette.neutralDark,
- iconColor: 'var(--button-iconColor)',
- menuIconColor: 'var(--button-menuIconColor)',
- },
-
- pressed: {
- background: semanticColors.buttonBackgroundPressed,
- borderColor: semanticColors.buttonBorder,
- contentColor: semanticColors.buttonTextPressed,
- secondaryContentColor: semanticColors.buttonTextPressed,
- iconColor: 'var(--button-iconColor)',
- menuIconColor: 'var(--button-menuIconColor)',
- },
-
- focused: {
- background: 'var(--button-background)',
- borderColor: 'var(--button-borderColor)',
- contentColor: 'var(--button-contentColor)',
- iconColor: 'var(--button-iconColor)',
- menuIconColor: 'var(--button-menuIconColor)',
- secondaryContentColor: 'var(--button-focused-contentColor)',
- },
-
- checked: {
- background: semanticColors.buttonBackgroundPressed,
- contentColor: semanticColors.buttonTextChecked,
- },
-
- checkedHovered: {
- background: semanticColors.buttonBackgroundPressed,
- contentColor: semanticColors.buttonTextCheckedHovered,
- },
-
- disabled: {
- background: semanticColors.buttonBackgroundDisabled,
- borderColor: semanticColors.buttonBorderDisabled,
- contentColor: semanticColors.buttonTextDisabled,
- secondaryContentColor: semanticColors.buttonTextDisabled,
- iconColor: 'var(--button-disabled-contentColor)',
- },
- },
-
- // TODO: This will be moved out as a card variant.
- card: {
- size: {
- smallest: {
- borderRadius: '4px',
- height: 'auto',
- margin: 0,
- padding: '8px',
- width: 'auto',
- },
- smaller: {
- borderRadius: '4px',
- height: 'auto',
- margin: 0,
- padding: '8px',
- width: 'auto',
- },
- small: {
- borderRadius: '4px',
- height: 'auto',
- margin: 0,
- padding: '8px',
- width: 'auto',
- },
- medium: {
- borderRadius: '4px',
- height: 'auto',
- margin: 0,
- padding: '16px',
- width: 'auto',
- },
- large: {
- borderRadius: '6px',
- height: 'auto',
- margin: 0,
- padding: '16px',
- width: 'auto',
- },
- larger: {
- borderRadius: '6px',
- height: 'auto',
- margin: 0,
- padding: '16px',
- width: 'auto',
- },
- largest: {
- borderRadius: '6px',
- height: 'auto',
- margin: 0,
- padding: '16px',
- width: 'auto',
- },
- },
-
- backgroundColor: '#ffffff',
- borderColor: 'transparent',
- borderWidth: '1px',
- boxShadow: '0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1)',
- minHeight: '32px',
- minWidth: '100px',
-
- borderRadius: 'var(--card-size-medium-borderRadius)',
- height: 'var(--card-size-medium-height)',
- margin: 'var(--card-size-medium-margin)',
- padding: 'var(--card-size-medium-padding)',
- width: 'var(--card-size-medium-width)',
-
- hovered: {
- backgroundColor: 'var(--card-backgroundColor)',
- borderColor: 'var(--card-borderColor)',
- borderWidth: 'var(--card-borderWidth)',
- boxShadow: 'var(--card-boxShadow)',
- },
-
- pressed: {
- backgroundColor: 'var(--card-backgroundColor)',
- borderColor: 'var(--card-borderColor)',
- borderWidth: 'var(--card-borderWidth)',
- boxShadow: 'var(--card-boxShadow)',
- },
-
- selected: {
- backgroundColor: '#fafafa',
- borderColor: 'var(--card-borderColor)',
- borderWidth: 'var(--card-borderWidth)',
- boxShadow: 'var(--card-boxShadow)',
- },
-
- disabled: {
- backgroundColor: '#f0f0f0',
- borderColor: 'var(--card-borderColor)',
- borderWidth: 'var(--card-borderWidth)',
- boxShadow: '0 0.8px 1.8px 0 rgba(0, 0, 0, 0.1)',
- },
-
- clickable: {
- backgroundColor: '#ffffff',
- borderColor: 'transparent',
- borderWidth: '1px',
- boxShadow: '0 1.6px 3.6px 0 rgba(0, 0, 0, 0.1)',
-
- hovered: {
- backgroundColor: '#fafafa',
- borderColor: 'var(--card-clickable-borderColor)',
- borderWidth: 'var(--card-clickable-borderWidth)',
- boxShadow: '0 3.2px 7.2px 0 rgba(0, 0, 0, 0.1)',
- },
-
- pressed: {
- backgroundColor: '#f5f5f5',
- borderColor: 'var(--card-clickable-borderColor)',
- borderWidth: '2px',
- boxShadow: 'var(--card-clickable-boxShadow)',
- },
- },
-
- compact: {
- padding: 0,
- },
-
- fluid: {
- height: '100%',
- width: '100%',
- },
- },
},
+
tokens,
);
diff --git a/packages/react-theme-provider/src/index.ts b/packages/react-theme-provider/src/index.ts
index 518f6f89f75d9..94cc33f400da6 100644
--- a/packages/react-theme-provider/src/index.ts
+++ b/packages/react-theme-provider/src/index.ts
@@ -5,6 +5,7 @@ export * from './ThemeProvider.types';
export * from './useThemeProviderClasses';
export * from './useThemeProvider';
export * from './useThemeProviderState';
+export * from './withThemeProvider';
export { useTheme } from './useTheme';
export { ThemeContext } from './ThemeContext';
@@ -14,6 +15,7 @@ export * from './tokensToStyleObject';
export * from './useInlineTokens';
export { createDefaultTheme } from './createDefaultTheme';
export * from './themes/index';
+export * from './makeVariantClasses';
export * from './makeStyles';
export * from './makeClasses';
export { IStyle, IRawStyle, IRawFontStyle, IStyleFunctionOrObject } from '@uifabric/merge-styles';
diff --git a/packages/react-theme-provider/src/makeClasses.ts b/packages/react-theme-provider/src/makeClasses.ts
index 283f92ffab28a..07c082d90e63d 100644
--- a/packages/react-theme-provider/src/makeClasses.ts
+++ b/packages/react-theme-provider/src/makeClasses.ts
@@ -60,15 +60,20 @@ export const makeClasses = (
break;
case 2:
+ const modifierName = parts[1];
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- if ((state as any)[parts[1]]) {
+ if ((state as any)[modifierName] || (state as any).variant === modifierName) {
_setClass(state, value);
}
break;
case 3:
+ const enumName = parts[1];
+ const enumValue = parts[2];
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- if ((state as any)[parts[1]] === parts[2]) {
+ if ((state as any)[enumName] === enumValue) {
_setClass(state, value);
}
break;
diff --git a/packages/react-theme-provider/src/makeStyles.ts b/packages/react-theme-provider/src/makeStyles.ts
index 3a888bcf810d8..44e3600672065 100644
--- a/packages/react-theme-provider/src/makeStyles.ts
+++ b/packages/react-theme-provider/src/makeStyles.ts
@@ -52,10 +52,11 @@ export function makeStyles(
return (theme?: Theme, renderer?: StyleRenderer) => {
const win = useWindow();
+ const contextualTheme = useTheme();
+ const contextualRenderer = useStyleRenderer();
- // Expected: theme and renderer are either always provided or never.
- theme = theme || useTheme() || {};
- renderer = (renderer || useStyleRenderer()) as StyleRenderer;
+ theme = theme || contextualTheme || {};
+ renderer = (renderer || contextualRenderer) as StyleRenderer;
const id = renderer.getId();
const isStyleFunction = typeof styleOrFunction === 'function';
diff --git a/packages/react-theme-provider/src/makeVariantClasses.test.tsx b/packages/react-theme-provider/src/makeVariantClasses.test.tsx
new file mode 100644
index 0000000000000..c777767e79970
--- /dev/null
+++ b/packages/react-theme-provider/src/makeVariantClasses.test.tsx
@@ -0,0 +1,101 @@
+import * as React from 'react';
+import { makeVariantClasses } from './makeVariantClasses';
+import { Stylesheet, InjectionMode } from '@uifabric/merge-styles';
+import { ReactWrapper } from 'enzyme';
+import { MergeStylesProvider } from './styleRenderers/mergeStylesRenderer';
+import { ThemeContext } from './ThemeContext';
+import { safeMount } from '@uifabric/test-utilities';
+import { Theme } from './types';
+
+describe('makeVariantClasses', () => {
+ const _stylesheet: Stylesheet = Stylesheet.getInstance();
+
+ _stylesheet.setConfig({ injectionMode: InjectionMode.none });
+
+ beforeEach(() => {
+ _stylesheet.reset();
+ });
+
+ const useClasses = makeVariantClasses({
+ name: 'Foo',
+ prefix: '--foo',
+ variants: {
+ root: {
+ background: 'red',
+ },
+ primary: {
+ background: 'green',
+ },
+ },
+ });
+
+ const Foo = (props: { className?: string; primary?: boolean }) => {
+ const state = { ...props };
+
+ useClasses(state);
+
+ return ;
+ };
+
+ it('can render default base variant', () => {
+ safeMount(
+
+
+ ,
+ (wrapper: ReactWrapper) => {
+ expect(
+ wrapper
+ .first()
+ .getDOMNode()
+ .getAttribute('class'),
+ ).toEqual('Foo-0');
+ expect(_stylesheet.getRules()).toEqual('.Foo-0{--foo-background:red;}.Foo--primary-1{--foo-background:green;}');
+ },
+ );
+ });
+
+ it('can render primary variant', () => {
+ safeMount(
+
+
+ ,
+ (wrapper: ReactWrapper) => {
+ expect(
+ wrapper
+ .first()
+ .getDOMNode()
+ .getAttribute('class'),
+ ).toEqual('Foo-0 Foo--primary-1');
+ expect(_stylesheet.getRules()).toEqual('.Foo-0{--foo-background:red;}.Foo--primary-1{--foo-background:green;}');
+ },
+ );
+ });
+
+ it('can respect themed variant overrides', () => {
+ const theme = ({
+ components: {
+ Foo: {
+ variants: {
+ primary: {
+ background: 'purple',
+ },
+ },
+ },
+ },
+ } as unknown) as Theme;
+
+ safeMount(
+
+
+
+
+ ,
+ (wrapper: ReactWrapper) => {
+ expect(wrapper.getDOMNode().getAttribute('class')).toEqual('Foo-0 Foo--primary-1');
+ expect(_stylesheet.getRules()).toEqual(
+ '.Foo-0{--foo-background:red;}.Foo--primary-1{--foo-background:purple;}',
+ );
+ },
+ );
+ });
+});
diff --git a/packages/react-theme-provider/src/makeVariantClasses.ts b/packages/react-theme-provider/src/makeVariantClasses.ts
new file mode 100644
index 0000000000000..30fe3f4e2bd90
--- /dev/null
+++ b/packages/react-theme-provider/src/makeVariantClasses.ts
@@ -0,0 +1,87 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+import { tokensToStyleObject } from './tokensToStyleObject';
+import { Variants, Theme } from '@fluentui/theme';
+import { IStyle } from '@uifabric/merge-styles';
+import { makeClasses } from './makeClasses';
+
+/**
+ * Calls a function with the argument, or returns the given object.
+ * @param objOrFunc - Function or object.
+ * @param argument - Argument to pass if a function is provided.
+ */
+const callOrReturn = (objOrFunc: any, argument: any) =>
+ typeof objOrFunc === 'function' ? objOrFunc(argument) : objOrFunc;
+
+const processVariants = (variants: Variants | undefined, theme: Theme, name?: string, prefix?: string) => {
+ const result: Record = {};
+
+ if (variants) {
+ variants = callOrReturn(variants, theme);
+
+ for (const variantName of Object.keys(variants!)) {
+ const modifierName = variantName === 'root' ? variantName : '_' + variantName;
+
+ const rule: any = (result[modifierName] = tokensToStyleObject(variants![variantName], prefix) as IStyle);
+
+ // The display name should be tied to the unique theme object, causing the
+ // renderer to treat scoped themes as sandboxed css scopes.
+ if (name) {
+ rule.displayName = `${name}${theme.id || ''}`;
+ if (variantName !== 'root') {
+ rule.displayName += `--${variantName}`;
+ }
+ }
+ }
+ }
+
+ return result;
+};
+
+/**
+ * Options for makeVariantClasses.
+ */
+export type MakeVariantClassesOptions = {
+ /**
+ * Name of the component to use for fetching variants from the theme.
+ */
+ name?: string;
+
+ /**
+ * Prefix for css variables within the variants.
+ */
+ prefix?: string;
+
+ /**
+ * Styles for the component.
+ */
+ styles?: Record | ((theme: Theme) => Record);
+
+ /**
+ * Variants for the styles. A variant defines token values when a particular prop is present, or the
+ * variant prop matches.
+ */
+ variants?: Variants | ((theme: Theme) => Variants);
+};
+
+/**
+ * Hook factory for creating a `use*Variants` helper. Variants represent a configuration of
+ * token values mapped to modifiers on the component. A variant can also be referenced using
+ * a variant string. Variants can be overridden through the theme of the component.
+ */
+export const makeVariantClasses = (options: MakeVariantClassesOptions) => {
+ const { styles, variants, name, prefix } = options;
+
+ // This function will only be called when styles have not been evaluated for this set for
+ // the particular theme/window/direction combo.
+ const styleFunction: (theme: Theme) => IStyle = (theme: Theme) => {
+ const themeVariants = name ? theme?.components?.[name]?.variants : undefined;
+
+ return [
+ callOrReturn(styles, theme),
+ processVariants(variants, theme, name, prefix),
+ processVariants(themeVariants, theme, name, prefix),
+ ];
+ };
+
+ return makeClasses(styleFunction as any);
+};
diff --git a/packages/react-theme-provider/src/renderThemeProvider.tsx b/packages/react-theme-provider/src/renderThemeProvider.tsx
index 1e8072f452b18..2645deeb39194 100644
--- a/packages/react-theme-provider/src/renderThemeProvider.tsx
+++ b/packages/react-theme-provider/src/renderThemeProvider.tsx
@@ -1,29 +1,18 @@
import * as React from 'react';
import { ThemeProviderState } from './ThemeProvider.types';
import { getSlots } from '@fluentui/react-compose/lib/next/index';
-import { CustomizerContext, ICustomizerContext } from '@uifabric/utilities';
+import { CustomizerContext } from '@uifabric/utilities';
import { ThemeContext } from './ThemeContext';
-import { Theme } from '@fluentui/theme';
import { StyleRendererContext } from './styleRenderers/useStyleRenderer';
-function createCustomizerContext(theme: Theme): ICustomizerContext {
- return {
- customizations: {
- inCustomizerContext: true,
- settings: { theme },
- scopedSettings: theme.components || {},
- },
- };
-}
-
export const renderThemeProvider = (state: ThemeProviderState) => {
const { slots, slotProps } = getSlots(state);
- const { theme } = state;
+ const { theme, customizerContext } = state;
return (
-
+
diff --git a/packages/react-theme-provider/src/styleRenderers/mergeStylesRenderer.tsx b/packages/react-theme-provider/src/styleRenderers/mergeStylesRenderer.tsx
index c99a6d6fbaa80..284d2dd1333a9 100644
--- a/packages/react-theme-provider/src/styleRenderers/mergeStylesRenderer.tsx
+++ b/packages/react-theme-provider/src/styleRenderers/mergeStylesRenderer.tsx
@@ -20,7 +20,7 @@ export const mergeStylesRenderer: StyleRenderer = {
renderStyles: (styleSet, options) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- return mergeCssSets([styleSet as any], options) as any;
+ return mergeCssSets((Array.isArray(styleSet) ? styleSet : [styleSet]) as any, options) as any;
},
renderFontFace: (fontFace, options) => {
diff --git a/packages/react-theme-provider/src/styleRenderers/types.ts b/packages/react-theme-provider/src/styleRenderers/types.ts
index 983c2479766a2..13fd11f9d8067 100644
--- a/packages/react-theme-provider/src/styleRenderers/types.ts
+++ b/packages/react-theme-provider/src/styleRenderers/types.ts
@@ -3,7 +3,7 @@ import { IFontFace, IKeyframes } from '@uifabric/merge-styles';
export type FontFace = IFontFace;
export type KeyFrames = IKeyframes;
export type StyleRendererOptions = {
- rtl: boolean;
+ rtl?: boolean;
targetWindow: Window | undefined;
};
diff --git a/packages/react-theme-provider/src/styleRenderers/useStyleRenderer.tsx b/packages/react-theme-provider/src/styleRenderers/useStyleRenderer.tsx
index d1446bf866036..93879136606a5 100644
--- a/packages/react-theme-provider/src/styleRenderers/useStyleRenderer.tsx
+++ b/packages/react-theme-provider/src/styleRenderers/useStyleRenderer.tsx
@@ -4,8 +4,10 @@ import { StyleRenderer } from './types';
export const StyleRendererContext = React.createContext({
reset: () => undefined,
getId: () => -1,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- renderStyles: rules => ({} as any),
+ renderStyles: rules => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ return {} as any;
+ },
renderFontFace: () => undefined,
renderKeyframes: () => '',
});
diff --git a/packages/react-theme-provider/src/tokensToStyleObject.test.ts b/packages/react-theme-provider/src/tokensToStyleObject.test.ts
index 6202acbed8dc5..01a0cfb3355f8 100644
--- a/packages/react-theme-provider/src/tokensToStyleObject.test.ts
+++ b/packages/react-theme-provider/src/tokensToStyleObject.test.ts
@@ -41,4 +41,15 @@ describe('tokensToStyleObject', () => {
'--ms-body-text': 'blue',
});
});
+
+ it('can no-op on objects that have already been converted', () => {
+ const styleObject = tokensToStyleObject(
+ {
+ background: 'red',
+ },
+ '--button',
+ );
+
+ expect(tokensToStyleObject(styleObject)).toBe(styleObject);
+ });
});
diff --git a/packages/react-theme-provider/src/tokensToStyleObject.ts b/packages/react-theme-provider/src/tokensToStyleObject.ts
index e90f09644b917..22a13fa6456ca 100644
--- a/packages/react-theme-provider/src/tokensToStyleObject.ts
+++ b/packages/react-theme-provider/src/tokensToStyleObject.ts
@@ -2,14 +2,25 @@ import * as React from 'react';
import { TokenSetType } from '@fluentui/theme';
export const tokensToStyleObject = (
- tokens?: TokenSetType,
+ tokens?: TokenSetType | React.CSSProperties,
prefix?: string,
style: React.CSSProperties | undefined = {},
): React.CSSProperties => {
+ let hasCheckedObject = false;
+
if (tokens) {
for (const name of Object.keys(tokens)) {
+ // On the first token property, check if this object has already been tokenized.
+ if (!hasCheckedObject) {
+ if (name.indexOf('--') === 0) {
+ return tokens as React.CSSProperties;
+ }
+
+ hasCheckedObject = true;
+ }
+
const varName = prefix ? `${prefix}${name === 'default' ? '' : '-' + name}` : `--${name}`;
- const varValue = tokens[name];
+ const varValue = (tokens as TokenSetType)[name];
if (varValue && typeof varValue === 'object') {
tokensToStyleObject(varValue as { [key: string]: TokenSetType }, varName, style);
@@ -19,5 +30,6 @@ export const tokensToStyleObject = (
}
}
}
+
return style;
};
diff --git a/packages/react-theme-provider/src/useThemeProviderClasses.tsx b/packages/react-theme-provider/src/useThemeProviderClasses.tsx
index 243707fcbc57a..fde673fa55b4e 100644
--- a/packages/react-theme-provider/src/useThemeProviderClasses.tsx
+++ b/packages/react-theme-provider/src/useThemeProviderClasses.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import { css } from '@uifabric/utilities';
import { useDocument } from '@fluentui/react-window-provider';
-import { IRawStyle } from '@uifabric/styling';
import { makeStyles } from './makeStyles';
import { ThemeProviderState } from './ThemeProvider.types';
import { tokensToStyleObject } from './tokensToStyleObject';
+import { Theme } from './types';
-const useThemeProviderStyles = makeStyles(theme => {
+const useThemeProviderStyles = makeStyles((theme: Theme) => {
const { tokens } = theme;
- const tokenStyles = tokensToStyleObject(tokens) as IRawStyle;
+ const tokenStyles = tokensToStyleObject(tokens);
return {
root: tokenStyles,
@@ -23,7 +23,8 @@ const useThemeProviderStyles = makeStyles(theme => {
WebkitFontSmoothing: 'var(--body-webkitFontSmoothing)',
},
],
- };
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ } as Record;
});
/**
@@ -62,8 +63,9 @@ function useApplyClassToBody(state: ThemeProviderState, classesToApply: string[]
export function useThemeProviderClasses(state: ThemeProviderState): void {
const classes = useThemeProviderStyles(state.theme, state.renderer);
+ const { className, applyTo } = state;
+
useApplyClassToBody(state, [classes.root, classes.body]);
- const { className, applyTo } = state;
state.className = css(className, classes.root, applyTo === 'element' && classes.body);
}
diff --git a/packages/react-theme-provider/src/useThemeProviderState.tsx b/packages/react-theme-provider/src/useThemeProviderState.tsx
index dc8c5dd44073d..7a80af29b1c57 100644
--- a/packages/react-theme-provider/src/useThemeProviderState.tsx
+++ b/packages/react-theme-provider/src/useThemeProviderState.tsx
@@ -3,6 +3,27 @@ import * as React from 'react';
import { getTokens } from './getTokens';
import { ThemeProviderState } from './ThemeProvider.types';
import { useTheme } from './useTheme';
+import { getId, ICustomizerContext } from '@uifabric/utilities';
+
+const themeToIdMap = new Map();
+
+const getThemeId = (...themes: Theme[]) => {
+ const ids: string[] = [];
+
+ for (const theme of themes) {
+ if (theme) {
+ let id = theme.id || themeToIdMap.get(theme);
+
+ if (!id) {
+ id = getId('');
+ themeToIdMap.set(theme, id);
+ }
+ ids.push(id);
+ }
+ }
+
+ return ids.join('-');
+};
export const useThemeProviderState = (draftState: ThemeProviderState) => {
const userTheme = draftState.theme;
@@ -11,10 +32,24 @@ export const useThemeProviderState = (draftState: ThemeProviderState) => {
const parentTheme = useTheme();
// Update the incoming theme with a memoized version of the merged theme.
- draftState.theme = React.useMemo(() => {
+ const theme = (draftState.theme = React.useMemo(() => {
const mergedTheme = mergeThemes(parentTheme, userTheme);
mergedTheme.tokens = getTokens(mergedTheme);
+
+ mergedTheme.id = getThemeId(parentTheme, userTheme);
+
return mergedTheme;
- }, [parentTheme, userTheme]);
+ }, [parentTheme, userTheme]));
+
+ draftState.customizerContext = React.useMemo(
+ () => ({
+ customizations: {
+ inCustomizerContext: true,
+ settings: { theme },
+ scopedSettings: theme.components || {},
+ },
+ }),
+ [theme],
+ );
};
diff --git a/packages/react-theme-provider/src/withThemeProvider.tsx b/packages/react-theme-provider/src/withThemeProvider.tsx
new file mode 100644
index 0000000000000..227a7fed97887
--- /dev/null
+++ b/packages/react-theme-provider/src/withThemeProvider.tsx
@@ -0,0 +1,9 @@
+import * as React from 'react';
+import { ThemeProvider } from './ThemeProvider';
+
+export const withThemeProvider = (Component: React.FunctionComponent) =>
+ React.forwardRef((props, ref) => (
+
+
+
+ ));
diff --git a/packages/theme/etc/theme.api.md b/packages/theme/etc/theme.api.md
index e2c4fe857401a..189dd7b9114bb 100644
--- a/packages/theme/etc/theme.api.md
+++ b/packages/theme/etc/theme.api.md
@@ -15,31 +15,28 @@ export const AnimationStyles: IAnimationStyles;
export const AnimationVariables: IAnimationVariables;
// @public
-export type ColorTokens = Partial<{
- background: string;
- contentColor: string;
- secondaryContentColor: string;
- linkColor: string;
- iconColor: string;
- borderColor: string;
- dividerColor: string;
- focusColor: string;
- focusInnerColor: string;
- opacity: string;
-}>;
-
-// @public (undocumented)
-export type ColorTokenSet = ColorTokens & ColorTokenStates;
+export type ColorTokens = ColorTokenSet & {
+ hovered?: ColorTokens;
+ pressed?: ColorTokens;
+ disabled?: ColorTokens;
+ checked?: ColorTokens;
+ checkedHovered?: ColorTokens;
+ checkedPressed?: ColorTokens;
+};
// @public
-export type ColorTokenStates = Partial<{
- hovered: ColorTokens;
- pressed: ColorTokens;
- disabled: ColorTokens;
- checked: ColorTokens;
- checkedHovered: ColorTokens;
- checkedPressed: ColorTokens;
-}>;
+export type ColorTokenSet = {
+ background?: string;
+ contentColor?: string;
+ secondaryContentColor?: string;
+ linkColor?: string;
+ iconColor?: string;
+ borderColor?: string;
+ dividerColor?: string;
+ focusColor?: string;
+ focusInnerColor?: string;
+ opacity?: string;
+};
// @public (undocumented)
export namespace CommunicationColors {
@@ -66,6 +63,7 @@ export interface ComponentStyles {
// (undocumented)
[componentName: string]: {
styles?: IStyleFunctionOrObject;
+ variants?: Variants;
};
}
@@ -832,6 +830,8 @@ export interface Theme extends ITheme {
// (undocumented)
components?: ComponentStyles;
// (undocumented)
+ id?: string;
+ // (undocumented)
stylesheets?: string[];
// (undocumented)
tokens?: Tokens;
@@ -854,6 +854,9 @@ export type TokenSetType = {
[key: string]: TokenSetType | string | number | undefined;
};
+// @public (undocumented)
+export type Variants = Record;
+
// Warnings were encountered during analysis:
//
diff --git a/packages/theme/src/types/Theme.ts b/packages/theme/src/types/Theme.ts
index 0f3869ca0d6ee..9fa3cea0dc5c9 100644
--- a/packages/theme/src/types/Theme.ts
+++ b/packages/theme/src/types/Theme.ts
@@ -9,18 +9,18 @@ export type SizeValue = 'smallest' | 'smaller' | 'small' | 'medium' | 'large' |
/**
* A baseline set of color plates.
*/
-export type ColorTokens = Partial<{
- background: string;
- contentColor: string;
- secondaryContentColor: string;
- linkColor: string;
- iconColor: string;
- borderColor: string;
- dividerColor: string;
- focusColor: string;
- focusInnerColor: string;
- opacity: string;
-}>;
+export type ColorTokenSet = {
+ background?: string;
+ contentColor?: string;
+ secondaryContentColor?: string;
+ linkColor?: string;
+ iconColor?: string;
+ borderColor?: string;
+ dividerColor?: string;
+ focusColor?: string;
+ focusInnerColor?: string;
+ opacity?: string;
+};
/**
* A set of states for each color plate to use.
@@ -42,16 +42,14 @@ export type ColorTokens = Partial<{
* compatible with other platforms reusing token names, we have decided to snap
* to "pressed".
*/
-export type ColorTokenStates = Partial<{
- hovered: ColorTokens;
- pressed: ColorTokens;
- disabled: ColorTokens;
- checked: ColorTokens;
- checkedHovered: ColorTokens;
- checkedPressed: ColorTokens;
-}>;
-
-export type ColorTokenSet = ColorTokens & ColorTokenStates;
+export type ColorTokens = ColorTokenSet & {
+ hovered?: ColorTokens;
+ pressed?: ColorTokens;
+ disabled?: ColorTokens;
+ checked?: ColorTokens;
+ checkedHovered?: ColorTokens;
+ checkedPressed?: ColorTokens;
+};
export type FontTokens = Partial<{
fontFamily: string;
@@ -81,10 +79,14 @@ export interface Tokens {
[key: string]: TokenSetType;
}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export declare type Variants = Record;
+
export interface ComponentStyles {
[componentName: string]: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
styles?: IStyleFunctionOrObject;
+ variants?: Variants;
};
}
@@ -95,6 +97,7 @@ export interface Theme extends ITheme {
components?: ComponentStyles;
tokens?: Tokens;
stylesheets?: string[];
+ id?: string;
}
/**
diff --git a/packages/utilities/src/getId.ts b/packages/utilities/src/getId.ts
index eb808403ca316..6ba57729b809a 100644
--- a/packages/utilities/src/getId.ts
+++ b/packages/utilities/src/getId.ts
@@ -32,7 +32,7 @@ export function getId(prefix?: string): string {
let index = _global[CURRENT_ID_PROPERTY]++;
- return (prefix || DEFAULT_ID_STRING) + index;
+ return (prefix === undefined ? DEFAULT_ID_STRING : prefix) + index;
}
/**