Header menu logo Sutil

PseudoCss Module

Experimental pseudo-CSS styles

Functions and values

Function or value Description

addClass n

Full Usage: addClass n

Parameters:
    n : obj

Returns: string * obj

A pseudo-style that will add the given class if the rule matches. This example would add the class framework-button to any button element.

 let css = [
     rule "button" [
         PseudoCss.addClass "framework-button"
     ]
 ]

 let view() =
     Html.button [
         text "Styled as a framework button"
     ] |> withStyle css
val css: obj list
val view: unit -> 'a
This was an experiment that would let me build DOM and then use a Sutil scoped style sheet to lift various elements into an 3rd-party framework (such as Bulma). In hindsight, it's too magical, not comprehensively implemented with respect to rule matching, and better achieved in other ways (for example, create wrapper buttons for the framework).

n : obj
Returns: string * obj

Type something to start searching.