diff --git a/demo_markdown/docs/divider/mod.md b/demo_markdown/docs/divider/mod.md index 385e2d9..aeb3e9b 100644 --- a/demo_markdown/docs/divider/mod.md +++ b/demo_markdown/docs/divider/mod.md @@ -2,9 +2,29 @@ ```rust demo view! { - "top" - - "bottom" + +
+ +
+
+ "Text" +
+
+} +``` + +### Vertical + +```rust demo +view! { + +
+ +
+
+ "Text" +
+
} ``` diff --git a/thaw/src/divider/divider.css b/thaw/src/divider/divider.css index 949ecb9..2f33222 100644 --- a/thaw/src/divider/divider.css +++ b/thaw/src/divider/divider.css @@ -2,12 +2,71 @@ .thaw-divider { position: relative; display: flex; + flex-direction: row; + align-items: center; + flex-grow: 1; width: 100%; - margin: 1.5rem 0; + font-family: var(--fontFamilyBase); + font-size: var(--fontSizeBase200); + font-weight: var(--fontWeightRegular); + color: var(--colorNeutralForeground2); + line-height: var(--lineHeightBase200); + box-sizing: border-box; + text-align: center; } -.thaw-divider__line { - background-color: #efeff5; - height: 1px; - width: 100%; +.thaw-divider--vertical { + flex-direction: column; + width: auto; + height: 100%; + min-height: 20px; } + +.thaw-divider::before { + content: ""; + display: flex; + flex-grow: 1; + min-width: 8px; + border-top-width: var(--strokeWidthThin); + border-top-style: solid; + border-color: var(--colorNeutralStroke2); + box-sizing: border-box; +} + +.thaw-divider--vertical::before { + min-width: auto; + min-height: 8px; + border-top-width: medium; + border-top-style: none; + border-right-width: var(--strokeWidthThin); + border-right-style: solid; +} + + +.thaw-divider::after { + content: ""; + display: flex; + flex-grow: 1; + min-width: 8px; + border-top-width: var(--strokeWidthThin); + border-top-style: solid; + border-color: var(--colorNeutralStroke2); + box-sizing: border-box; +} + +.thaw-divider--vertical::after { + min-width: auto; + min-height: 8px; + border-top-width: medium; + border-top-style: none; + border-right-width: var(--strokeWidthThin); + border-right-style: solid; +} + +.thaw-divider__wrapper { + margin: 0 12px; +} + +.thaw-divider--vertical > .thaw-divider__wrapper { + margin: 12px 0; +} \ No newline at end of file diff --git a/thaw/src/divider/mod.rs b/thaw/src/divider/mod.rs index a3793ca..830926a 100644 --- a/thaw/src/divider/mod.rs +++ b/thaw/src/divider/mod.rs @@ -1,13 +1,26 @@ use leptos::*; +use thaw_components::OptionComp; use thaw_utils::{class_list, mount_style, OptionalProp}; #[component] -pub fn Divider(#[prop(optional, into)] class: OptionalProp>) -> impl IntoView { +pub fn Divider( + #[prop(optional, into)] class: OptionalProp>, + #[prop(optional, into)] vertical: MaybeSignal, + #[prop(optional)] children: Option, +) -> impl IntoView { mount_style("divider", include_str!("./divider.css")); view! { -
-
+ } } diff --git a/thaw/src/theme/color.rs b/thaw/src/theme/color.rs index fa259d9..6c246c7 100644 --- a/thaw/src/theme/color.rs +++ b/thaw/src/theme/color.rs @@ -25,6 +25,7 @@ pub struct ColorTheme { pub color_neutral_stroke_1: String, pub color_neutral_stroke_1_hover: String, pub color_neutral_stroke_1_pressed: String, + pub color_neutral_stroke_2: String, pub color_neutral_stroke_accessible: String, pub color_neutral_stroke_accessible_hover: String, pub color_neutral_stroke_accessible_pressed: String, @@ -68,6 +69,7 @@ impl ColorTheme { color_neutral_stroke_1: "#d1d1d1".into(), color_neutral_stroke_1_hover: "#c7c7c7".into(), color_neutral_stroke_1_pressed: "#b3b3b3".into(), + color_neutral_stroke_2: "#e0e0e0".into(), color_neutral_stroke_accessible: "#616161".into(), color_neutral_stroke_accessible_hover: "#575757".into(), color_neutral_stroke_accessible_pressed: "#4d4d4d".into(), @@ -111,6 +113,7 @@ impl ColorTheme { color_neutral_stroke_1: "#666666".into(), color_neutral_stroke_1_hover: "#757575".into(), color_neutral_stroke_1_pressed: "#6b6b6b".into(), + color_neutral_stroke_2: "#525252".into(), color_neutral_stroke_accessible: "#adadad".into(), color_neutral_stroke_accessible_hover: "#bdbdbd".into(), color_neutral_stroke_accessible_pressed: "#b3b3b3".into(),