Skip to content

Clarify CSS url conversions in README #234

Open
@mrj

Description

@mrj

Propshaft's README currently has the following text to describe how URLs in CSS files are converted:

Propshaft will automatically convert asset references in CSS to use the digested file names. So background: url("/bg/pattern.svg") is converted to background: url("/assets/bg/pattern-2169cbef.svg") before the stylesheet is served.

This only works if "bg" is a subdirectory of an asset path like "images". If "bg" is it's own top-level asset directory, url("pattern.svg") (with or without a leading slash) must instead be written. Similarly, the principle of least surprise path url("images/pattern.svg") won't usually work for assets in "images". So, most-commonly, such CSS URLs won't contain slashes, making the "bg" example misleading.

Suggested text: The path given in a CSS URL must be the path of that asset relative to one of the registered asset directory paths. [examples...]

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