Skip to content

Commit 00b19bc

Browse files
authored
docs: Add Gradients docs (#1116)
* docs: Add Gradients docs * chore: Fmt * chore: Clean up * fix
1 parent 83696e6 commit 00b19bc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

crates/elements/src/_docs/color_syntax.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
//! - With HSL and alpha: `hsl(28deg, 80%, 50%, 25%)`
2323
//! - With Hex: `#E93323`
2424
//!
25+
//! #### Gradients
26+
//!
27+
//! Syntax is `<type>-gradient(<angle>, ...[<color> <offset>],)`
28+
//!
29+
//! And supported types are `linear`/`radial`/`conic`
30+
//!
31+
//! Examples:
32+
//! - Linear: `linear-gradient(250deg, orange 15%, rgb(255, 0, 0) 50%, rgb(255, 192, 203) 80%)`
33+
//! - Radial: `radial-gradient(orange 15%, rgb(255, 0, 0) 50%, rgb(255, 192, 203) 80%)`
34+
//! - Conic: `conic-gradient(250deg, orange 15%, rgb(255, 0, 0) 50%, rgb(255, 192, 203) 80%)`
35+
//!
2536
//! #### SVG
2637
//!
2738
//! For the `svg` element you can also use:

examples/gradient.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ fn app() -> Element {
3333
rsx!(rect {
3434
height: "100%",
3535
width: "100%",
36+
spacing: "8",
37+
padding: "8",
3638
background,
3739
Button {
3840
onpress: move |_| gradient.set(GradientExample::Linear),

0 commit comments

Comments
 (0)