-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e3959
commit 7c48868
Showing
23 changed files
with
378 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ org.gradle.parallel=true | |
org.gradle.caching=true | ||
|
||
group=io.github.allangomes | ||
version=0.0.2 | ||
version=0.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
lib/src/main/kotlin/io/github/allangomes/kotlinwind/css/core/WithInt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.github.allangomes.kotlinwind.css.core | ||
|
||
class WithInt<T>( | ||
private val block: Function1<Int, T> | ||
) { | ||
operator fun get(value: Int): T { | ||
return block(value) | ||
} | ||
|
||
} |
8 changes: 2 additions & 6 deletions
8
...es/kotlinwind/css/core/WithFloatAndInt.kt → ...angomes/kotlinwind/css/core/WithNumber.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
lib/src/main/kotlin/io/github/allangomes/kotlinwind/css/features/Opacity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.github.allangomes.kotlinwind.css.features | ||
|
||
import io.github.allangomes.kotlinwind.css.api.KWScope | ||
import io.github.allangomes.kotlinwind.css.core.OPACITY | ||
import io.github.allangomes.kotlinwind.css.core.WithInt | ||
|
||
interface Opacity<T> : KWScope<T> { | ||
|
||
val opacity: WithInt<T> get() = WithInt { | ||
OPACITY value "${it.toFloat() / 100f}" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
lib/src/main/kotlin/io/github/allangomes/kotlinwind/css/features/grid/GridTemplateColumns.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.github.allangomes.kotlinwind.css.features.grid | ||
|
||
import io.github.allangomes.kotlinwind.css.api.KWScope | ||
import io.github.allangomes.kotlinwind.css.core.DISPLAY | ||
import io.github.allangomes.kotlinwind.css.core.GRID | ||
import io.github.allangomes.kotlinwind.css.core.GRID_TEMPLATE_COLUMNS | ||
import io.github.allangomes.kotlinwind.css.core.WithInt | ||
|
||
@Suppress("PropertyName") | ||
interface GridTemplateColumns<T> : KWScope<T> { | ||
|
||
val cols: WithInt<T> get() = WithInt { | ||
DISPLAY value GRID | ||
GRID_TEMPLATE_COLUMNS value "repeat($it, minmax(0, 1fr))" | ||
} | ||
|
||
val cols_none: WithInt<T> get() = WithInt { | ||
GRID_TEMPLATE_COLUMNS value "none" | ||
} | ||
|
||
val cols_subgrid: WithInt<T> get() = WithInt { | ||
DISPLAY value GRID | ||
GRID_TEMPLATE_COLUMNS value "subgrid" | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
lib/src/main/kotlin/io/github/allangomes/kotlinwind/css/features/mask/Mask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.allangomes.kotlinwind.css.features.mask | ||
|
||
import io.github.allangomes.kotlinwind.css.api.KWRoot | ||
import io.github.allangomes.kotlinwind.css.api.KWScope | ||
|
||
class Mask(kw: KWRoot) : | ||
KWScope.Scoped<Mask>(kw), | ||
MaskImage<Mask>, | ||
MaskOrigin<Mask>, | ||
MaskPosition<Mask>, | ||
MaskRepeat<Mask>, | ||
MaskSize<Mask> |
21 changes: 21 additions & 0 deletions
21
lib/src/main/kotlin/io/github/allangomes/kotlinwind/css/features/mask/MaskImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.github.allangomes.kotlinwind.css.features.mask | ||
|
||
import io.github.allangomes.kotlinwind.css.api.KWScope | ||
import io.github.allangomes.kotlinwind.css.core.* | ||
|
||
@Suppress("PropertyName") | ||
interface MaskImage<T> : KWScope<T> { | ||
|
||
@StyleValueMarker | ||
val image: WithToken<T, String> get() = WithToken { | ||
WEBKIT+MASK_IMAGE value "url('$it')" | ||
MASK_IMAGE value "url('$it')" | ||
} | ||
|
||
@StyleValueMarker | ||
val image_none get() = run { | ||
WEBKIT+MASK_IMAGE value "none" | ||
MASK_IMAGE value "none" | ||
} | ||
|
||
} |
Oops, something went wrong.