Skip to content

Naming the css units class?  #4

@Zaid-Ajaj

Description

@Zaid-Ajaj

I am not what to call the helper class that contains the different CSS units like px and rem. I have now called it length, implemented like this:

[<Erase>]
type length =
    static member inline px(value: int) : ICssUnit = unbox ((unbox<string>value) + "px")
    static member inline px(value: double) : ICssUnit = unbox ((unbox<string>value) + "px")
    static member inline cm(value: int) : ICssUnit = unbox ((unbox<string>value) + "cm")
    static member inline cm(value: double) : ICssUnit = unbox ((unbox<string>value) + "cm")
    /// etc. etc.

and you can use it like this:

style.margin (length.px 20)

but I am not sure if length is a good name for it, what do you think @MangelMaxime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions