Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added viewport units (lvw,dvw,svw,lvh,dvh,svh) #2764

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ interface CSSUnit {
interface vw: CSSUnitRel

interface vh: CSSUnitRel

interface lvh: CSSUnitRel

interface dvh: CSSUnitRel

interface svh: CSSUnitRel

interface lvw: CSSUnitRel

interface dvw: CSSUnitRel

interface svw: CSSUnitRel

interface vi: CSSUnitRel

Expand Down Expand Up @@ -123,6 +135,18 @@ interface CSSUnit {
inline val vw get() = "vw".unsafeCast<vw>()

inline val vh get() = "vh".unsafeCast<vh>()

inline val lvh get() = "lvh".unsafeCast<vh>()

inline val dvh get() = "dvh".unsafeCast<vh>()

inline val svh get() = "svh".unsafeCast<vh>()

inline val lvw get() = "lvw".unsafeCast<vw>()

inline val dvw get() = "dvw".unsafeCast<vw>()

inline val svw get() = "svw".unsafeCast<vw>()

inline val vi get() = "vi".unsafeCast<vi>()

Expand Down Expand Up @@ -196,6 +220,24 @@ val Number.vw

val Number.vh
get(): CSSSizeValue<CSSUnit.vh> = CSSUnitValueTyped(this.toFloat(), CSSUnit.vh)

val Number.lvw
get(): CSSSizeValue<CSSUnit.lvw> = CSSUnitValueTyped(this.toFloat(), CSSUnit.lvw)

val Number.dvw
get(): CSSSizeValue<CSSUnit.dvw> = CSSUnitValueTyped(this.toFloat(), CSSUnit.dvw)

val Number.svw
get(): CSSSizeValue<CSSUnit.svw> = CSSUnitValueTyped(this.toFloat(), CSSUnit.svw)

val Number.lvh
get(): CSSSizeValue<CSSUnit.lvh> = CSSUnitValueTyped(this.toFloat(), CSSUnit.lvh)

val Number.dvh
get(): CSSSizeValue<CSSUnit.dvh> = CSSUnitValueTyped(this.toFloat(), CSSUnit.dvh)

val Number.svh
get(): CSSSizeValue<CSSUnit.svh> = CSSUnitValueTyped(this.toFloat(), CSSUnit.svh)

val Number.vmin
get(): CSSSizeValue<CSSUnit.vmin> = CSSUnitValueTyped(this.toFloat(), CSSUnit.vmin)
Expand Down