Package-level declarations

This package contains the logic for the OudsTheme composable, including the OudsThemeTweak mechanism and the implementation of the theme contract that injects visual data into the application.

Types

Link copied to clipboard
data class OudsBorders(val width: OudsBorders.Width, val radius: OudsBorders.Radius, val style: OudsBorders.Style)

Holds all the border-related properties defined in the OUDS theme.

Link copied to clipboard

Available border styles in OUDS.

Link copied to clipboard
data class OudsColorMode

The color mode associated with a colored background. This defines how content is displayed when it is layout on a colored background.

Link copied to clipboard

Holds all the colour-related properties defined in the OUDS theme.

Link copied to clipboard
data class OudsComponents(val navigationBar: OudsComponents.NavigationBar)

Holds component-specific tokens that are exposed for public use.

Link copied to clipboard
data class OudsEffects(val blurDrag: Int)

Holds the visual effects defined in the OUDS theme.

Link copied to clipboard
data class OudsElevations(val none: Dp, val default: Dp, val drag: Dp, val emphasized: Dp, val raised: Dp, val sticky: Dp)

Holds the elevation values defined in the OUDS theme.

Link copied to clipboard
data class OudsGrids(val minWidth: Dp, val maxWidth: Dp, val margin: Dp, val columnGap: Dp)

Holds the grid-related properties defined in the OUDS theme.

Link copied to clipboard
data class OudsOpacities(val disabled: Float, val invisible: Float, val weakest: Float, val weaker: Float, val weak: Float, val medium: Float, val strong: Float, val opaque: Float)

Holds the opacity values defined in the OUDS theme.

Link copied to clipboard
data class OudsSizes(val icon: OudsSizes.Icon, val maxWidth: OudsSizes.MaxWidth, val minInteractiveArea: Dp)

Holds the size values defined in the OUDS theme.

Link copied to clipboard
data class OudsSpaces(val fixed: OudsSpaces.Fixed, val scaled: OudsSpaces.Scaled, val paddingInline: OudsSpaces.PaddingInline, val paddingBlock: OudsSpaces.PaddingBlock, val inset: OudsSpaces.Inset, val columnGap: OudsSpaces.ColumnGap, val rowGap: OudsSpaces.RowGap)

Holds the spacing values defined in the OUDS theme.

Link copied to clipboard
object OudsTheme

Object that stores tokens values for the current theme.

Link copied to clipboard
data class OudsTypography(val display: OudsTypography.Display, val heading: OudsTypography.Heading, val body: OudsTypography.Body, val label: OudsTypography.Label)

Holds the typography styles defined in the OUDS theme.

Properties

Link copied to clipboard

Returns this if it is not equal to Dp.Hairline, otherwise returns null.

Link copied to clipboard

Converts an OUDS typography token to the local typography value provided by the theme. Note that the typography value returned varies depending on the window size.

Functions

Link copied to clipboard
fun Modifier.dashedBorder(width: Dp, color: Color, shape: Shape = RectangleShape, intervals: List<Dp> = listOf(width * 2, width * 2), phase: Dp = 0.dp): Modifier

Modify element to add a dashed border styled with appearance specified with a width, a color and a shape, and clip it.

Link copied to clipboard
fun Modifier.dottedBorder(width: Dp, color: Color, shape: Shape = RectangleShape): Modifier

Modify element to add a dotted border styled with appearance specified with a width, a color and a shape, and clip it.

Link copied to clipboard

Determines if the OUDS theme is currently in dark mode.

Link copied to clipboard
fun OudsTheme(theme: OudsThemeContract, darkThemeEnabled: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit)

Applies the OUDS theme to the composable hierarchy.

Link copied to clipboard

Modifies the current OUDS theme configuration and applies it to the given content.

Link copied to clipboard
fun Modifier.outerBorder(width: Dp, color: Color, shape: Shape = RectangleShape, insetWidth: Dp = Dp.Unspecified, insetColor: Color = Color.Unspecified): Modifier

Modify element to add an outer border (drawn outside the element) with appearance specified with a width, a color and a shape.