Skip to content

Commit

Permalink
Bestter docs fore classes macro
Browse files Browse the repository at this point in the history
  • Loading branch information
basro committed Jan 14, 2024
1 parent 24271ac commit 8569219
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion stylance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ impl_join_classes_for_tuples!(
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
);

/// Utility macro for (conditionally) joining multiple class names
/// Utility macro for joining multiple class names.
///
/// The macro accepts `&str` `&String` and any refs of `T` where `T` implements `AsRef<str>`
///
/// It also accepts `Option` of those types, `None` values will be filtered from the list.
///
/// Example
///
Expand All @@ -325,6 +329,8 @@ impl_join_classes_for_tuples!(
/// my_style::header,
/// module_style::header,
/// // conditionally activate a global style
/// if active_tab == 0 { Some(my_style::active) } else { None }
/// // The same can be expressed with then_some:
/// (active_tab == 0).then_some(my_style::active)
/// );
/// ```
Expand Down

0 comments on commit 8569219

Please sign in to comment.