# CommonStyleScope

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/CommonStyle.kt+class:androidx.compose.foundation.style.CommonStyleScope) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface CommonStyleScope : CustomStyleScope, AnimateStyleScope, StyleStateScope, NestedStyleProviderStyleScope, NestedStyleConsumerStyleScope, StyleLayerScope
  ```

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyleScope` is the scope used by a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyle`. It provides the common implementation that all styles scopes share. Is created by a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleResolver` when resolving styles and is used to collect the properties set by a style.

## Summary

### Inherited functions

From [androidx.compose.foundation.style.AnimateStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/AnimateStyleScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/AnimateStyleScope#animate(androidx.compose.animation.core.AnimationSpec,androidx.compose.animation.core.AnimationSpec,kotlin.Function0)(
toSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>,
fromSpec: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>,
block: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html
)`

Specifies a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` whose properties will be animated to when they change, using the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec`.
Cmn From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).roundToPx()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` by rounding
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).roundToPx()()`

Convert Sp to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` by rounding
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toDp()()`

Convert an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixel value to `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toDp()()`

Convert a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` pixel value to a Dp
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.geometry.Size).toDpSize()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize`.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).toPx()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to pixels.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).toPx()()`

Convert Sp to pixels.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpRect).toRect()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpRect` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpSize).toSize()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toSp()()`

Convert an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixel value to Sp.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toSp()()`

Convert a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` pixel value to a Sp
Cmn From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.TextUnit).toDp()()`

Convert Sp to `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp`.
Cmn `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.Dp).toSp()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to Sp.
Cmn From [androidx.compose.foundation.style.NestedStyleConsumerStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleConsumerStyleScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleConsumerStyleScope#applyNestedStyle(androidx.compose.foundation.style.NestedStyleKey)(key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleKey)`

Applies a style with the given `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleConsumerStyleScope#applyNestedStyle(androidx.compose.foundation.style.NestedStyleKey)` defined in a parent style.
Cmn From [androidx.compose.foundation.style.NestedStyleProviderStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)(key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleKey, style: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/CommonStyle)`

Provides `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)` as a nested style to the nested composable identified by the provided `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/NestedStyleProviderStyleScope#provideNestedStyle(androidx.compose.foundation.style.NestedStyleKey,androidx.compose.foundation.style.CommonStyle)`.
Cmn From [androidx.compose.foundation.style.StyleLayerScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)(block: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

Raise the layer of properties that are set in `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleLayerScope#styleLayer(kotlin.Function0)`.
Cmn From [androidx.compose.foundation.style.StylePropertyProviderScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyProviderScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ProvidableStyleProperty<T>.https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StylePropertyProviderScope#(androidx.compose.foundation.style.ProvidableStyleProperty).provide(kotlin.Any)(value: T)`

Sets or updates the value of a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ProvidableStyleProperty`.
Cmn From [androidx.compose.foundation.style.StyleStateScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateScope#state(androidx.compose.foundation.style.StyleStateKey,kotlin.Function0,kotlin.Function2)(
key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateKey<T>,
block: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html,
active: (key: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateKey<T>, state: https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleState) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html
)`

A helper function to implement state reading extension functions such as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/package-summary#(androidx.compose.foundation.style.StyleStateScope).pressed(kotlin.Function0)`.
Cmn

### Inherited properties

From [androidx.compose.runtime.CompositionLocalAccessorScope](https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocalAccessorScope) `T` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal<T>.https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocalAccessorScope#(androidx.compose.runtime.CompositionLocal).currentValue()`

An extension property that allows accessing the current value of a composition local in the context of this scope.
Cmn From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#density()`

The logical density of the display.
Cmn From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#fontScale()`

Current user preference for the scaling factor for fonts.
Cmn From [androidx.compose.foundation.style.StyleStateScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateScope) `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleState` `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleStateScope#state()`

The state of the component. applying this style.
Cmn