shiny (version 0.8.0)

validateCssUnit: Validate proper CSS formatting of a unit

Description

Validate proper CSS formatting of a unit

Usage

validateCssUnit(x)

Arguments

x
The unit to validate. Will be treated as a number of pixels if a unit is not specified.

Value

  • A properly formatted CSS unit of length, if possible. Otherwise, will throw an error.

Examples

Run this code
validateCssUnit("10%")
validateCssUnit(400)  #treated as '400px'

Run the code above in your browser using DataCamp Workspace