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

Discussion: custom and default styling #15

@caroqliu

Description

@caroqliu

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)

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