Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ export const decorators = [
];

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
options: {
storySort: {
order: ["Configuration", "Components", "Forms", "Extensions", "CMEM", "*"],
},
},
actions: {
argTypesRegex: "^on[A-Z].*",
},
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- `<ApplicationViewability />`
- component for hiding elements in specific media
- `<InlineText />`
- force children to get displayed as inline content
- force children to get displayed as inline content
- `<StringPreviewContentBlobToggler />`
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
- CSS custom properties
- beside the color palette we now mirror the most important layout configuration variables as CSS custom properties

### Fixed

- `<Tag />`
- create more whitespace inside `small` tag
- reduce visual impact of border
- `<StringPreviewContentBlobToggler />`
- take Markdown rendering into account before testing the maximum preview length
- take Markdown rendering into account before testing the maximum preview length
- `<NodeContent />`
- header-menu items are vertically centered now
- `Typography`
- adjust displaying fallback symbols in different browsers
- adjust displaying fallback symbols in different browsers

### Changed

Expand All @@ -43,7 +45,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Deprecated

- `<StringPreviewContentBlobToggler />`
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`

## [25.0.0] - 2025-12-01

Expand Down
15 changes: 15 additions & 0 deletions src/components/Application/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@use "sass:list";

:root {
// creating css custom properties from palette colors
@each $palette-group-name, $palette-group-tints in $eccgui-color-palette-light {
@each $palette-tint-name, $palette-tint-colors in $palette-group-tints {
@for $i from 1 through list.length($palette-tint-colors) {
Expand All @@ -12,4 +13,18 @@
}
}
}

// set aliases for base colors
--#{$eccgui}-color-primary: #{$eccgui-color-primary};
--#{$eccgui}-color-primary-contrast: #{$eccgui-color-primary-contrast};
--#{$eccgui}-color-accent: #{$eccgui-color-accent};
--#{$eccgui}-color-accent-contrast: #{$eccgui-color-accent-contrast};
--#{$eccgui}-color-success-foreground: #{$eccgui-color-success-text};
--#{$eccgui}-color-success-background: #{$eccgui-color-success-background};
--#{$eccgui}-color-info-foreground: #{$eccgui-color-info-text};
--#{$eccgui}-color-info-background: #{$eccgui-color-info-background};
--#{$eccgui}-color-warning-foreground: #{$eccgui-color-warning-text};
--#{$eccgui}-color-warning-background: #{$eccgui-color-warning-background};
--#{$eccgui}-color-danger-foreground: #{$eccgui-color-danger-text};
--#{$eccgui}-color-danger-background: #{$eccgui-color-danger-background};
}
32 changes: 32 additions & 0 deletions src/configuration/_customproperties.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* We mirror our SCSS variables here to improve availability in inline styles
* and module styles without included SCSS config stack.
* Colors are set in `src/components/Application/_colors.scss`.
*/

:root {
--#{$eccgui}-size-typo-caption: #{$eccgui-size-typo-caption};
--#{$eccgui}-size-typo-caption-lineheight: #{$eccgui-size-typo-caption-lineheight};
--#{$eccgui}-size-typo-text: #{$eccgui-size-typo-text};
--#{$eccgui}-size-typo-text-lineheight: #{$eccgui-size-typo-text-lineheight};
--#{$eccgui}-size-typo-subtitle: #{$eccgui-size-typo-subtitle};
--#{$eccgui}-size-typo-subtitle-lineheight: #{$eccgui-size-typo-subtitle-lineheight};
--#{$eccgui}-size-typo-title: #{$eccgui-size-typo-title};
--#{$eccgui}-size-typo-title-lineheight: #{$eccgui-size-typo-title-lineheight};
--#{$eccgui}-size-typo-headline: #{$eccgui-size-typo-headline};
--#{$eccgui}-size-typo-headline-lineheight: #{$eccgui-size-typo-headline-lineheight};
--#{$eccgui}-font-weight-light: #{$eccgui-font-weight-light};
--#{$eccgui}-font-weight-regular: #{$eccgui-font-weight-regular};
--#{$eccgui}-font-weight-bold: #{$eccgui-font-weight-bold};
--#{$eccgui}-font-spacing-condensed: #{$eccgui-font-spacing-condensed};
--#{$eccgui}-font-spacing-regular: #{$eccgui-font-spacing-regular};
--#{$eccgui}-font-spacing-wide: #{$eccgui-font-spacing-wide};
--#{$eccgui}-size-block-whitespace: #{$eccgui-size-block-whitespace};
--#{$eccgui}-size-inline-whitespace: #{$eccgui-size-inline-whitespace};
--#{$eccgui}-opacity-regular: #{$eccgui-opacity-regular};
--#{$eccgui}-opacity-narrow: #{$eccgui-opacity-narrow};
--#{$eccgui}-opacity-muted: #{$eccgui-opacity-muted};
--#{$eccgui}-opacity-disabled: #{$eccgui-opacity-disabled};
--#{$eccgui}-opacity-ghostly: #{$eccgui-opacity-ghostly};
--#{$eccgui}-opacity-invisible: #{$eccgui-opacity-invisible};
}
118 changes: 118 additions & 0 deletions src/configuration/stories/customproperties.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import React from "react";
import { Meta, StoryFn } from "@storybook/react";

import CssCustomProperties from "../../common/utils/CssCustomProperties";
import {
Section,
SectionHeader,
Spacing,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableHeader,
TableRow,
TitleSubsection,
} from "../../components";
import { CLASSPREFIX as eccgui } from "../../index";

const groups: { title: string; filterName: (name: string) => boolean }[] = [
{
title: "Typography",
filterName: (name) => name.startsWith(`--${eccgui}-size-typo`),
},
{
title: "Font weights and spacing",
filterName: (name) => name.startsWith(`--${eccgui}-font`),
},
{
title: "Whitespace",
filterName: (name) => name.startsWith(`--${eccgui}-size-block`) || name.startsWith(`--${eccgui}-size-inline`),
},
{
title: "Color aliases",
filterName: (name) => name.startsWith(`--${eccgui}-color`) && !name.startsWith(`--${eccgui}-color-palette`),
},
{
title: "Opacity",
filterName: (name) => name.startsWith(`--${eccgui}-opacity`),
},
{
title: "Palette colors",
filterName: (name) => name.startsWith(`--${eccgui}-color-palette`),
},
];

const CssCustomPropertiesOverview = () => {
return (
<>
{groups.map(({ title, filterName }) => {
const properties = new CssCustomProperties({
selectorText: ":root",
filterName,
removeDashPrefix: false,
returnObject: false,
}).customProperties() as string[][];

return (
<React.Fragment key={title}>
<Section>
<SectionHeader>
<TitleSubsection>{title}</TitleSubsection>
</SectionHeader>
<Spacing size="tiny" />
<TableContainer>
<Table columnWidths={["60%", "40%"]}>
<TableHead>
<TableRow>
<TableHeader>CSS custom property</TableHeader>
<TableHeader>Current value</TableHeader>
</TableRow>
</TableHead>
<TableBody>
{properties.map(([name, value]) => (
<TableRow key={name}>
<TableCell>
<code>{name}</code>
</TableCell>
<TableCell>
{name.startsWith(`--${eccgui}-color`) && (
<span
style={{
display: "inline-block",
width: `var(--${eccgui}-size-block-whitespace)`,
height: `var(--${eccgui}-size-block-whitespace)`,
backgroundColor: value,
verticalAlign: "middle",
marginRight: `var(--${eccgui}-size-inline-whitespace)`,
border: "1px solid currentColor",
}}
/>
)}
<code>{value}</code>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</Section>
<Spacing size="large" />
</React.Fragment>
);
})}
</>
);
};

/**
* We mirror our SCSS configuration variables as CSS custom vars.
* This way they can be easily used for inline styles or in CSS modules without SCSS includes.
*/
export default {
title: "Configuration/CSS Custom Properties",
component: CssCustomPropertiesOverview,
} as Meta<typeof CssCustomPropertiesOverview>;

export const Default: StoryFn = () => <CssCustomPropertiesOverview />;
1 change: 1 addition & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// == load default configuration ===============================================

@import "./configuration/variables";
@import "./configuration/customproperties"; // mirror config as custom properties

// == Necessary imports from libraries =========================================

Expand Down
Loading