cssx

Documentation

Attributes

Property --content is used to set the content of an element.

p {
    --content: "This is the content of the paragraph";
}

It may contain other native CSS properties that will remain intact.

p {
    --content: "This is the content of the paragraph";
    font-size: 16px;
    color: blue;
}

Any variable will be passed as a property to the element.

button {
    --content: "Click me";
    --onclick: "alert(Hello, World!)";
    padding: 10px 16px;
}

Result

<button class="cssx-YnV0dG9u" onclick="alert(Hello, World!)">Click me</button>