micnews / story-json-to-amp

Compile story-json documents into AMP stories
Other
25 stars 8 forks source link

Replace templates with flexbox layout #33

Closed iefserge closed 6 years ago

iefserge commented 6 years ago

R = MAJOR

Removes templates in favor of flexbox layout:

New hello world:

{
  "version": 1,
  "title": "Hello World",
  "pages": [
    {
      "layers": [
        {
          "type": "container",
          "styles": {
            "backgroundColor": "#87d687"
          }
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "center",
            "alignItems": "center"
          },
          "elements": [
            {
              "type": "heading",
              "text": "Hello World"
            }
          ]
        }
      ]
    }
  ],
  "defaultStyles": {
    "heading": {
      "fontFamily": "sans-serif"
    }
  }
}
iefserge commented 6 years ago

@ryanscottaudio added automatic flex: 1 to all top level elements, which made hello world even shorter.