-
Notifications
You must be signed in to change notification settings - Fork 1
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
234ebae
commit 2292f95
Showing
5 changed files
with
200 additions
and
62 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
83 changes: 83 additions & 0 deletions
83
example-app/src/commonMain/kotlin/com/lightningkite/mppexampleapp/docs/TextElementScreen.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,83 @@ | ||
package com.lightningkite.mppexampleapp.docs | ||
|
||
import com.lightningkite.rock.ExternalServices | ||
import com.lightningkite.rock.Routable | ||
import com.lightningkite.rock.models.* | ||
import com.lightningkite.rock.reactive.* | ||
import com.lightningkite.rock.views.* | ||
import com.lightningkite.rock.views.direct.* | ||
import kotlin.random.Random | ||
|
||
@Routable("docs/text") | ||
object TextElementScreen : DocScreen { | ||
override val covers: List<String> = listOf("Text", "text", "subtext", "h1", "h2", "h3") | ||
|
||
override fun ViewWriter.render() { | ||
article { | ||
h1("Text Elements") | ||
text("Rock has a number of text elements to help you display text in a variety of ways.") | ||
h2("Text") | ||
text("The most basic text element is the text element. It simply displays text.") | ||
example("text(\"Hello, world!\")") { | ||
text("Hello, world!") | ||
} | ||
h2("Subtext") | ||
text("Subtext is a smaller, less important text element.") | ||
example("subtext(\"This is a subtext element.\")") { | ||
subtext("This is a subtext element.") | ||
} | ||
h2("Headers") | ||
text("Rock has the standard header elements from HTML, h1, h2, h3, h4, h5, and h6.") | ||
example("h1(\"This is an h1 header\")") { | ||
h1("This is an h1 header") | ||
} | ||
example("h2(\"This is an h2 header\")") { | ||
h2("This is an h2 header") | ||
} | ||
example("h3(\"This is an h3 header\")") { | ||
h3("This is an h3 header") | ||
} | ||
example("h4(\"This is an h4 header\")") { | ||
h4("This is an h4 header") | ||
} | ||
example("h5(\"This is an h5 header\")") { | ||
h5("This is an h5 header") | ||
} | ||
example("h6(\"This is an h6 header\")") { | ||
h6("This is an h6 header") | ||
} | ||
h2("How themes interact with text") | ||
text("Text elements are styled by the theme. You can change the theme to change the style of the text.") | ||
example( | ||
""" | ||
col { | ||
tweakTheme { it.copy(body = it.body.copy(bold = true)) } - text("Bold Text") | ||
tweakTheme { it.copy(foreground = Color.red) } - text("Red Text") | ||
} | ||
""".trimIndent() | ||
) { | ||
col { | ||
tweakTheme { it.copy(body = it.body.copy(bold = true)) } - text("Bold Text") | ||
tweakTheme { it.copy(foreground = Color.red) } - text("Red Text") | ||
} | ||
} | ||
text("Common style tweaks are available via some shortcuts.") | ||
example( | ||
""" | ||
col { | ||
bold - text("Bold Text") | ||
italic - text("Italic Text") | ||
allCaps - text("All Caps Text") | ||
} | ||
""".trimIndent() | ||
) { | ||
col { | ||
bold - text("Bold Text") | ||
italic - text("Italic Text") | ||
allCaps - text("All Caps Text") | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.