tomhodgins / css-package-manager

A Package Manager for CSS Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Brainstorm!

gmemstr opened this issue · comments

Let's brainstorm how we could make this work!

Taken from Discord:

image

I personally quite like the idea of embedding the packages directly into the stylesheet, although I wonder how easy the second, "alternative" approach would be. Maybe we take a hybrid approach? e.g

@--package-bootstrap {}
body {
	display: bootstrap-display;
}

Feel free to correct my CSS formatting but that's sort of what I have in my head. @--package- would help us parse out the packages that need to be brought in, maybe with the ability to define explicit URLs/versions/hashes with

@--package-bootstrap {
	url: url("https://example.com/bootstrap/v1.css");
}

(again, CSS syntax isn't perfect)

index.css

@require("package-one")
@require("package-two")

main {
  /* normal styles */
}

You could then maybe use PostCSS to take note of all the require statements before stripping them out.