# `Macaw.Component.Stylesheet`
[🔗](https://github.com/dcoai/macaw_component/blob/v0.1.2/lib/macaw/component/stylesheet.ex#L1)

Generated stylesheets (spec/01 §1.8): CSS a document defines at runtime, served from
`'self'` at a path addressed by its content, so the same document always yields the same
file and base renders capture it.

    iex> Macaw.Component.Stylesheet.path(".a{opacity:1}")
    "/assets/" <> Base.encode16(:crypto.hash(:sha256, ".a{opacity:1}"), case: :lower) <> ".css"

# `fault`

```elixir
@spec fault(term()) :: :not_a_string | :origin | nil
```

Why a stylesheet can't be served, or `nil`: `:not_a_string`, or `:origin` for an
`@import` or a `url(` that is not same-origin (a `data:` URL is allowed in `url(`).

# `path`

```elixir
@spec path(String.t()) :: String.t()
```

The stylesheet's path: `/assets/` and the lowercase SHA-256 of its bytes, `.css`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
