@jetbrains/kotlin-css
v1.0.0-pre.91
Published
Platform-agnostic CSS primitives (common module)
Downloads
86
Keywords
Readme
kotlin-css
Platform-agnostic CSS primitives.
Installation
To use kotlin-css
in the browser, install kotlin-css
and kotlin-css-js
using npm or Yarn:
npm i @jetbrains/kotlin-css @jetbrains/kotlin-css-js
npm run gen-idea-libs
To use kotlin-css
on the server, install kotlin-css
and kotlin-css-jvm
using Maven or Gradle.
See the Bintray page for Maven and Gradle installation instructions.
Getting Started
kotlin-css
is a DSL for authoring stylesheets in Kotlin. The DSL supports most common CSS properties and values,
including animations, transforms, shadows, flexbox, and grids. SVG properties are not supported yet,
contributions are welcome.
kotlin-css
is a low-level library. After constructing a stylesheet you can serialize it into a string and do with it
as you please:
val styles = CSSBuilder().apply {
body {
margin = 0.px
padding = 0.px
}
}
styles.toString()
When writing CSS for the browser you should probably use
kotlin-styled instead. It provides a
user-friendly facade to kotlin-css
.