Skip to content

@import rules should be hoisted to the top of the generated CSS file #305

@menelaos

Description

@menelaos

Steps to reproduce:

  1. stack new myapp yesodweb/simple
  2. Add @import "https://unpkg.com/open-props"; to the top of templates/default-layout.lucius
  3. In the same file, change the background-color for .masthead from rgb(27, 28, 29) to var(--red-5)
  4. Start the development server
  5. Observe that the background color is not red

Background:

If we open the dev tools, we see that --red-5 is not set:

Image

The problem seems to be that in the generated CSS file, the @import rule is not at the top of the file and thus gets ignored:

Image

While I haven't tested it, I presume this affects other at-rules, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions