Skip to content

Automatic styling of native HTML elements (Spectre Raw) #51

Description

@davestewart

Background

One of the great things about Spectre is its simplicity of design, but it could be even simpler by offering a build which would automatically style native HTML elements depending on their use case.

For example:

  • .table could be applied to raw table elements
  • .nav could be applied to aside nav ul classes
  • form classes could be applied directly to form elements like input[checkbox]

There are actually already a few frameworks like this in existence at the moment, including Pico CSS which both prove it works, and could take inspiration from.

Usage could be as simple as importing a separate stylesheet and adding a class:

<body class="spectre"> ... </body>

Proposal

Research how best this could be done; likely introducing a new export which leverages Post CSS @apply.

Then, experiment and run tests to see how easily it could be done.

Then, plan combinations of HTML and CSS should be applied.

It would also need its own section of the docs, and potentially playground.

Notes

See:

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationfeatureA brand new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions