ampproject / amp-react-prototype

A scratch pad to experiment with React rendered AMP Components
Apache License 2.0
36 stars 9 forks source link

Goober CSS prototype #64

Closed dvoytenko closed 4 years ago

dvoytenko commented 4 years ago

This prototype is using Goober. Some findings:

  1. Extensions do not seem to work via css'' form. But can be done via css({}). E.g. css{{...proto, ...overides}}.
  2. No num -> px conversion consistent with React's style (https://github.com/cristianbote/goober/issues/179).
  3. Keyframes support seems incomplete (https://github.com/cristianbote/goober/issues/178). No Emotion-style keyframes'' construct.
  4. No apparent way to override class name generator.

However, a CSS->class name construction is very convenient:

const button = css`
  font-weight: bold;
`;

As the result, there's no need for JSS's useStyles() hook indirection, which makes a smaller dependency in runtime. This is also very beneficial for rewriting.