Skip to content

Commit

Permalink
Update compose documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Nov 7, 2024
1 parent 27b476f commit 4128552
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sketch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ The example above will be compiled to the following CSS.
## Composition

Because we oftentimes need to compose CSS classes, Sketch provides a `compose`
function, acting like CSS Modules `compose` property. This allow you to reuse
CSS properties from another class, without having the burden of copy-pasting the
styles, or having to think on the class names to put in your nodes! Of course,
this remains totally optional. An example:
function. This allow you to reuse CSS properties from another class, without
having the burden of copy-pasting the styles, or having to think on the class
names to put in your nodes! Of course, this remains totally optional. An
example:

```gleam
fn button_style() {
Expand Down
2 changes: 1 addition & 1 deletion sketch/src/sketch.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,7 @@ pub fn important(style: Style) -> Style {
}

/// Compose styles by inheriting class, and later overrides them.
/// Works similarly to `composes` property in CSS modules.
/// Every styles from the class will be composed in the resulting class.
pub fn compose(class) -> Style {
style.ClassName(class)
}

0 comments on commit 4128552

Please sign in to comment.