diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2021-02-21 12:51:41 +0100 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2021-02-21 12:51:41 +0100 |
commit | b0a80f1fd48448394ec1aa06c353956d503fb2e2 (patch) | |
tree | f25836f546efdd129439fcf018128eee48d097ee /sw-ui/src/main | |
parent | Display military points on the left side of the wonder instead of over it (diff) | |
download | seven-wonders-b0a80f1fd48448394ec1aa06c353956d503fb2e2.tar.gz seven-wonders-b0a80f1fd48448394ec1aa06c353956d503fb2e2.tar.bz2 seven-wonders-b0a80f1fd48448394ec1aa06c353956d503fb2e2.zip |
Refactor GlobalStyles centering classes
Diffstat (limited to 'sw-ui/src/main')
3 files changed, 8 insertions, 8 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/GlobalStyles.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/GlobalStyles.kt index f9ea80b5..a4ffed64 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/GlobalStyles.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/GlobalStyles.kt @@ -27,15 +27,15 @@ object GlobalStyles : StyleSheet("GlobalStyles", isStatic = true) { val fixedCenter by css { position = Position.fixed - left = 50.pct - top = 50.pct - transform { - translate((-50).pct, (-50).pct) - } + +centerLeftTopTransform } - val centerInParent by css { + val centerInPositionedParent by css { position = Position.absolute + +centerLeftTopTransform + } + + val centerLeftTopTransform by css { left = 50.pct top = 50.pct transform { diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/PreparedMove.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/PreparedMove.kt index 3cb230e0..1acaacdf 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/PreparedMove.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/PreparedMove.kt @@ -54,7 +54,7 @@ fun RBuilder.preparedMove( private fun StyledDOMBuilder<DIV>.discardText() { styledDiv { css { - +GlobalStyles.centerInParent + +GlobalStyles.centerInPositionedParent +GameStyles.discardMoveText } +"DISCARD" diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Tokens.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Tokens.kt index 846a9f07..3df359ed 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Tokens.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/Tokens.kt @@ -112,7 +112,7 @@ fun RBuilder.tokenWithCount( tokenImage(tokenName, title = title, size = imgSize) styledSpan { css { - +GlobalStyles.centerInParent + +GlobalStyles.centerInPositionedParent tokenCountStyle(tokenCountSize, brightText, customCountStyle) } +"$count" |