Skip to content

Allow setting background images using CSS variables #8

@dawaltconley

Description

@dawaltconley

This is the cleanest way to handle combining responsive backgrounds with other background layers like linear-gradient. The backgroundFromSizes method would return this:

@media ${selectors} {
  ${selector} {
    ${varName}: url('${q.url}');
  }
}

Only unsure if this should be the default or if I should even support returning background-image. It's easy enough to make this a default for varName, but disallowing it would allow setting :root as a default selector, fewer required variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions