Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared CSS design proposal #662

Open
apaleslimghost opened this issue Nov 14, 2019 · 0 comments
Open

Shared CSS design proposal #662

apaleslimghost opened this issue Nov 14, 2019 · 0 comments

Comments

@apaleslimghost
Copy link
Member

(this document subject to bikeshedding)

goals

  • apps shouldn't need to know about the implementation details of components to load their styles
  • any top-level component can declare CSS that can be shared between apps
  • apps must be explicit about what shared CSS they require

in components

we add an extra field to package.json, shared-styles, with the following structure:

{
	"shared-styles": {
		"blocking": "./blocking.scss",
		"non-blocking": "./non-blocking.scss"
	}
}

in Page Kit

we add a new page-kit-cli plugin, dotcom-build-shared-styles, which takes an array of components to load shared styles from, and modifies the config to add every discovered shared style as an entry point, using a common naming convention of __shared-${component}-${blocking}.

we reintroduce glob discovery of entry points to dotcom-server-asset-loader to allow it to output an array of all __shared entry points, blocking and non-blocking, to Shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant