Skip to content

Instantly share code, notes, and snippets.

@GeePawHill
Created February 12, 2023 07:46
Show Gist options
  • Save GeePawHill/91dc558769260be7b8cff5f842db2449 to your computer and use it in GitHub Desktop.
Save GeePawHill/91dc558769260be7b8cff5f842db2449 to your computer and use it in GitHub Desktop.
val page = HtmlPageDelegate.page {
head {
stylesheet {
selector("*") {
display += block
}
}
}
body {
div("stinky") {
selector(".stinky") {
display += block
media("only screen and (min-width: 600px)") {
display += inline
}
}
nav("silly") {
selector(".silly") {
declarations["width"] = "100px"
}
}
}
}
}
println(page.pretty)
<html>
<head>
<style>
* {
display: block;
}
.stinky {
display: block;
}
.silly {
width: 100px;
}
@media only screen and (min-width: 600px) {
.stinky {
display: inline;
}
}
</style>
</head>
<body>
<div class="stinky">
<nav class="silly">
</nav>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment