Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Discussion: custom and default styling #15

Open
caroqliu opened this issue Apr 6, 2020 · 2 comments
Open

Discussion: custom and default styling #15

caroqliu opened this issue Apr 6, 2020 · 2 comments

Comments

@caroqliu
Copy link
Contributor

caroqliu commented Apr 6, 2020

Objective

Establish a default styling heuristic that is compatible with the three modes of usage in Bento

Summary

The CSS in Bento AMP document discusses the following main points:

  • The state of AMP's current and future default and custom styling
    • Default styles in AMP: build step transforming CSS to JS
    • Custom styles in AMP: inline or with restricted CSS in <style amp-custom>
    • Custom styles in Bento: inline or unrestricted CSS in <style>\
    • Custom styles in Preact: CSS modules or styled-components via props.style.
  • Default styles in AMP are one of (1) functionally crucial or (2) visually enhancing. We want some way to enforce (1) while making (2) optional. Even more, we ideally want (2) to be all-or-nothing, rather than publishers styling their components on a delicate combination of (2) and their custom styles. This makes it possible to modify low-stakes CSS rules without breaking live usage.
  • Core principles for Bento:
    • Propagate all props to component
    • Wrap functionally crucial styles
    • Never compromise mutability between modes
    • Optionally provide visually enhancing styles (for the reasons described earlier)
@caroqliu
Copy link
Contributor Author

@dvoytenko
Copy link
Contributor

That's the good discussion and an interesting feature. Unfortunately it's limited in scope and doesn't help with our React components - only with Web Components. But we definitely should understand and see how this fits.

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

No branches or pull requests

2 participants