Skip to content

Commit

Permalink
feat: ContentAlpha 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
cometj03 committed Dec 27, 2023
1 parent 5d97d2c commit 3a7fa38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.takeOrElse
import com.yourssu.design.system.compose.foundation.LocalContentColor
import com.yourssu.design.system.compose.foundation.LocalYdsContentAlpha
import com.yourssu.design.system.compose.foundation.YdsTextStyle

@Composable
fun YdsText(
text: String,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
style: YdsTextStyle = LocalTextStyle.current
style: YdsTextStyle = LocalTextStyle.current,
) {
val textColor = color.takeOrElse {
style.color.takeOrElse {
LocalContentColor.current
LocalContentColor.current.copy(alpha = LocalYdsContentAlpha.current)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.yourssu.design.system.compose.foundation

import androidx.compose.runtime.compositionLocalOf

val LocalYdsContentAlpha = compositionLocalOf { 1f }

0 comments on commit 3a7fa38

Please sign in to comment.