LineaUI.Installer.Css (linea_ui v0.3.0)

Copy Markdown View Source

The edits mix linea_ui.install makes to the app's assets/css/app.css, as pure functions from the file's contents to its new contents.

Every edit is idempotent: it finds what it would add and leaves the file alone when it is there.

Summary

Functions

Adds the Hugeicons Tailwind plugin after the LineaUI styles import. Unchanged when present.

Adds @source for LineaUI's templates, which Tailwind needs when source(none) turned its automatic detection off. Unchanged when the stylesheet already has it.

Whether the stylesheet still loads daisyUI.

Imports LineaUI's fonts and styles after Tailwind's import.

Removes the daisyUI and heroicons @plugin blocks (with the comment above each) and the data-theme dark variant Phoenix generates next to them, which LineaUI's .dark class replaces.

Whether the stylesheet turns Tailwind's automatic source detection off with source(none).

Whether the stylesheet imports Tailwind, the anchor the other edits are placed after.

Functions

add_hugeicons(css)

@spec add_hugeicons(String.t()) :: String.t()

Adds the Hugeicons Tailwind plugin after the LineaUI styles import. Unchanged when present.

add_source(css)

@spec add_source(String.t()) :: String.t()

Adds @source for LineaUI's templates, which Tailwind needs when source(none) turned its automatic detection off. Unchanged when the stylesheet already has it.

daisyui?(css)

@spec daisyui?(String.t()) :: boolean()

Whether the stylesheet still loads daisyUI.

import_styles(css)

@spec import_styles(String.t()) :: String.t()

Imports LineaUI's fonts and styles after Tailwind's import.

Returns the stylesheet unchanged when it has no Tailwind import or already imports both.

replace_daisyui(css)

@spec replace_daisyui(String.t()) :: String.t()

Removes the daisyUI and heroicons @plugin blocks (with the comment above each) and the data-theme dark variant Phoenix generates next to them, which LineaUI's .dark class replaces.

source_none?(css)

@spec source_none?(String.t()) :: boolean()

Whether the stylesheet turns Tailwind's automatic source detection off with source(none).

tailwind?(css)

@spec tailwind?(String.t()) :: boolean()

Whether the stylesheet imports Tailwind, the anchor the other edits are placed after.