Skip to content

Rethink steal-css' purpose #16

@matthewp

Description

@matthewp

This is meant to document recent discussions on the expectations for what steal-css gives you. ccing possibly interested parties; @mjstahl @kylegifford @pYr0x @justinbmeyer @ccummings @James0x57

What steal-css is today

For the sake of clarity this is what steal-css does for you today:

  1. Allows you to import css from JavaScript. This css is injected into the <head> of your document.
  2. Rewrites @import statements to be relative to the css file.
  3. Rewrites url() expressions to be relative to the css file.
  4. Supports the use of the locate scheme.

That's it.

Problems / expectations

  • The introduction of locate scheme changed expectations for what steal-css provides, it does not provide modularity to your CSS dependency tree. @import still behaves the same as if you used it within a <link> or <style> tag. This makes it somewhat of an anti-feature if used in a project with more than 1 CSS dependency tree (virtually all Steal projects).

Possible Solutions

  • Define a meta-language on top of CSS that makes the CSS dependency graph part of the Steal dependency graph. ie; create a better @import for CSS.
  • Provide hooks that existing compile-to-CSS languages can use to integrate with this. Lots of hand-waving as I don't know what this would entail; but in the case of less you can't simply ignore subsequent imports. It would be nice of steal-css could account for that some how.

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