Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YDS-#237] LocalYdsContentAlpha 추가 #238

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }