struct Components::SafeLength

Overview

A validated CSS length. Rejects the string-passthrough hole entirely by only ever being constructed from a number + a fixed unit — there is no constructor that takes an arbitrary CSS length string.

Defined in:

components/safe/safe_style.cr

Constructors

Instance Method Summary

Constructor Detail

def self.percent(n : Number) : SafeLength #

[View source]
def self.px(n : Number) : SafeLength #

[View source]
def self.rem(n : Number) : SafeLength #

[View source]
def self.zero : SafeLength #

[View source]

Instance Method Detail

def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def to_s : String #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]