css-package-manager icon indicating copy to clipboard operation
css-package-manager copied to clipboard

Brainstorm!

Open gmemstr opened this issue 6 years ago • 2 comments

Let's brainstorm how we could make this work!

Taken from Discord:

image

gmemstr avatar Nov 15 '19 11:11 gmemstr

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)

gmemstr avatar Nov 15 '19 15:11 gmemstr

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.

Dan503 avatar Nov 18 '19 08:11 Dan503