Skip to content

Commit

Permalink
Improve OverrideDarkMode kdocs (#552)
Browse files Browse the repository at this point in the history
Now it makes it clear that OverrideDarkMode does not change the theme,
and provides an example on how to do that.
  • Loading branch information
rock3r authored Aug 19, 2024
1 parent 3541805 commit 6ade536
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,22 @@ public val LocalConsoleTextStyle: ProvidableCompositionLocal<TextStyle> =
error("No ConsoleTextStyle provided. Have you forgotten the theme?")
}

/** Overrides the dark mode for the current composition scope. */
/**
* Overrides the [isDark] value for the [content]. It is used to inject a
* different dark mode style in a sub-tree.
*
* Note: this does _not_ change the theme. If you want to change the theme,
* you need to do it by yourself. For example, in standalone:
* ```kotlin
* IntUiTheme(isDark = false) {
* Text("I am light")
*
* IntUiTheme(isDark = true) {
* Text("I am dark")
* }
* }
* ```
*/
@Composable
public fun OverrideDarkMode(
isDark: Boolean,
Expand Down

0 comments on commit 6ade536

Please sign in to comment.