@jetbrains/kotlin-css

1.0.0-pre.91 • Public • Published

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:

  1. npm i @jetbrains/kotlin-css @jetbrains/kotlin-css-js

  2. 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.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @jetbrains/kotlin-css

Weekly Downloads

0

Version

1.0.0-pre.91

License

Apache-2-0

Unpacked Size

50.9 kB

Total Files

113

Last publish

Collaborators

  • skoch13
  • jetbrains-admin
  • kotlin
  • jetbrains-buildserver
  • allvo
  • bashor