ioet / ioet-website-v2

IOET website
MIT License
0 stars 0 forks source link

WWW-83 Handle incoming styling from contentful on selected components #23

Closed Wason1797 closed 4 years ago

Wason1797 commented 4 years ago

Hi team, please review this PR. @JuanJosephG and I added support for powerful styling directives coming from contentful. This is on an early version but upon our initial testing, it works fine.

You could use the styles field on contentful and populate with material ui styling directives like this:

    "root": {
        "backgroundImage": "transparent.ioetOrange",
        "backgroundSize": "cover",
        "backgroundPosition": "center center",
        "backgroundRepeat": "no-repeat",
        "color": "white",
        "height": 500
    },
    "textContainer": {
        "marginTop": 20,
        "marginBottom": 0.5,
        "margin": "auto",
        "padding": 2
    },
    "text": {
        "p": {
            "align": "justify"
        }
    }
}

Take into consideration that for some components there are extra directives, or some were disabled.