Repository: JetBrains/compose-multiplatform
File: html/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleSheet.kt (Kotlin)

Code before:
 *
 * @param prefix Will be used as prefix with current style. Pass `null` to use default value (classname of realization)
 *
 * @see [Style]
 *
 * Example:
 * ```
 * object AppStylesheet : StyleSheet() {
 *     val containerClass by style {
 *         padding(24.px)
 *     }
 * }
 * ```
 *
 * Usage Example:
 * ```
 *    Style(AppStylesheet) // this mounts the stylesheet
 *    Div(classes = listOf(AppStylesheet.containerClass),...)
 * ```
 */
open class StyleSheet(
    prefix: String?,
    private val rulesHolder: CSSRulesHolder = CSSRulesHolderState(),
) : StyleSheetBuilder, CSSRulesHolder by rulesHolder {
    private val boundClasses = mutableMapOf<String, CSSRuleDeclarationList>()
    val prefix = prefix ?: "${this::class.simpleName}-"

    constructor(
        rulesHolder: CSSRulesHolder = CSSRulesHolderState(),
        usePrefix: Boolean = true
    ) : this(
        if (usePrefix) null else "",
        rulesHolder
    )

    protected fun style(cssRule: CSSBuilder.() -> Unit) = CSSHolder(prefix, cssRule)

    /**
     * Example:
     * ```
     * object AppStyleSheet : StyleSheet() {
     *  val bounce by keyframes {
     *  from {
     *       property("transform", "translateX(50%)")
     *  }
     *
     *  to {
     *      property("transform", "translateX(-50%)")
     *  }
     * }
     *

Review comment (suggestion):
does `prefix` need to be public? can it be private?

Also to preserve the compatibility, maybe it's worth to add a public `val usePrefix` with only getter that returns true when prefix is not null. 

I gues `val usePrefix` didn't need to be public at all, but since it's already here, it's better to avoid breaking changes.

Code after:
 *
 * @param customPrefix Will be used as prefix with current style. Pass `null` to use default value (classname of realization)
 *
 * @see [Style]
 *
 * Example:
 * ```
 * object AppStylesheet : StyleSheet() {
 *     val containerClass by style {
 *         padding(24.px)
 *     }
 * }
 * ```
 *
 * Usage Example:
 * ```
 *    Style(AppStylesheet) // this mounts the stylesheet
 *    Div(classes = listOf(AppStylesheet.containerClass),...)
 * ```
 */
open class StyleSheet(
    customPrefix: String?,
    private val rulesHolder: CSSRulesHolder = CSSRulesHolderState(),
) : StyleSheetBuilder, CSSRulesHolder by rulesHolder {
    private val boundClasses = mutableMapOf<String, CSSRuleDeclarationList>()
    protected val prefix: String = customPrefix ?: "${this::class.simpleName}-"

    val usePrefix: Boolean = customPrefix == null
    constructor(
        rulesHolder: CSSRulesHolder = CSSRulesHolderState(),
        usePrefix: Boolean = true
    ) : this(
        if (usePrefix) null else "",
        rulesHolder
    )

    protected fun style(cssRule: CSSBuilder.() -> Unit) = CSSHolder(prefix, cssRule)

    /**
     * Example:
     * ```
     * object AppStyleSheet : StyleSheet() {
     *  val bounce by keyframes {
     *  from {
     *       property("transform", "translateX(50%)")
     *  }
     *
     *  to {
     *      property("transform", "translateX(-50%)")
     *  }
     * }