Skip to content

New option: inline stylesheet #198

@ChiefOfGxBxL

Description

@ChiefOfGxBxL

Issue

Generated sites load so fast, that HTML is rendered "bare", and then styles are applied later, leading to a flash of unstyled text (FOUT) issue.

Proposed solution

I've manually patched my own site, but I'd like to contribute a solution for others to use. This would only be a few lines.

  1. Add a new site parameter (useInlineStylesheet [boolean])
  2. Update layouts/partials/head/css.html:
    • If useInlineStylesheet is true, put combined CSS in a <style> tag
    • Else, keep the current logic of linking combined CSS file in a <link rel="stylesheet"> tag

I'm thinking that using a site parameter would help, because in the (unlikely) case that users have large stylesheets, they may want to use an external link rather than inline it.

LMK your thoughts, and what an appropriate default should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions