diff --git a/docs/pages/components/state.md b/docs/pages/components/state.md new file mode 100644 index 0000000..e9bd35f --- /dev/null +++ b/docs/pages/components/state.md @@ -0,0 +1,51 @@ +--- +title: 'Components: State - Sloth.css' +description: State component of Sloth.css. +--- + +## State + +The state component can be used for areas that indicate a certain state for users to get information, +that something is missing or needs to be done first to achieve a goal. + +### Empty state + +Use the `.state.empty` classes for a placeholder section which awaits user input to show a result. + +
+
+ +

You have no playlists

+

Click the button to start collecting songs

+ +
+
+ +```html +
+ ... +

You have no playlists

+

Click the button to start collecting songs

+ +
+``` + +### Highlighted state + +Use the `.state.highlighted` classes for an accentuated section e.g. which awaits a user action like a drag and drop target area. + +
+
+ +

Office document conversion

+

Drag supported documents here

+
+
+ +```html +
+ ... +

Office document conversion

+

Drag supported documents here

+
+``` diff --git a/eleventy.config.js b/eleventy.config.js index d22a9cd..4ef0ab6 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -31,6 +31,7 @@ module.exports = function(eleventyConfig) { 'breadcrumb', 'callout', 'separator', + 'state', ], }); diff --git a/src/_components.css b/src/_components.css index 660a475..bc3bb7a 100644 --- a/src/_components.css +++ b/src/_components.css @@ -10,7 +10,7 @@ /* @import 'components/_notification.css'; */ @import 'components/_separator.css'; /* @import 'components/_sequence.css'; */ -/* @import 'components/_state.css'; */ +@import 'components/_state.css'; /* @import 'components/_step.css'; */ /* @import 'components/_tab.css'; */ /* @import 'components/_tag.css'; */ diff --git a/src/components/_state.css b/src/components/_state.css new file mode 100644 index 0000000..1f728a0 --- /dev/null +++ b/src/components/_state.css @@ -0,0 +1,29 @@ +.state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 4rem 2rem; + + h1, h2, h3, h4, h5, h6 { + color: var(--color-text-muted); + margin: .5rem 0 0 0; + } + + &.empty { + background-color: var(--color-background-muted); + color: var(--color-text-muted); + + h1, h2, h3, h4, h5, h6 { + color: var(--color-text-muted); + } + } + &.highlighted { + background-color: color-mix(in hsl, var(--color-accent) 70%, black); + color: var(--color-text-dark); + + h1, h2, h3, h4, h5, h6 { + color: var(--color-text-dark); + } + } +}