Commit d5d54002 authored by Ben Galloway's avatar Ben Galloway

Upgrade to Material-UI v4

parent 962520ba
{ {
"name": "@gsc/material", "name": "@gsc/material",
"version": "1.1.0", "version": "2.0.0",
"description": "An implementation of Material-UI with GSC styling", "description": "An implementation of Material-UI with GSC styling",
"main": "index.js", "main": "index.js",
"repository": "https://git.gsc.org.uk/utils/gsc-material.git", "repository": "https://gitlab.gsc.org.uk/gsc-frameworks/gsc-material.git",
"author": "Ben Galloway <ben.galloway@gsc.org.uk>", "author": "Ben Galloway <ben.galloway@gsc.org.uk>",
"license": "MIT", "license": "MIT",
"private": true, "private": true,
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"ProximaNovaFontFace.css" "ProximaNovaFontFace.css"
], ],
"peerDependencies": { "peerDependencies": {
"@material-ui/core": "^3.3.0" "@material-ui/core": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.1.2", "@babel/cli": "^7.1.2",
......
import React from "react"; import React from "react";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles"; import { MuiThemeProvider, createMuiTheme, responsiveFontSizes } from "@material-ui/core/styles";
import { CssBaseline } from "@material-ui/core"; import { CssBaseline } from "@material-ui/core";
const GSCTheme = createMuiTheme({ const GSCTheme = responsiveFontSizes(
palette: { createMuiTheme({
primary: { gsc: {
main: "#2e2d44", // Core
contrastText: "#f1f4f5", navy: "#2e2d44",
teal: "#30b7bb",
offwhite: "#f1f4f5",
// Secondary
pink: "#e12a58",
gold: "#e5b94c",
// Tertiary
darkteal: "#036173",
blue: "#36a9e1",
lime: "#d5db40",
orange: "#e56a0c",
red: "#e40426",
purple: "#64335f",
green: "#22b573",
white: "#ffffff",
}, },
secondary: { palette: {
main: "#30b7bb", primary: {
contrastText: "#2e2d44", main: theme.gsc.navy,
contrastText: theme.gsc.offwhite,
},
secondary: {
main: theme.gsc.teal,
contrastText: theme.gsc.navy,
},
error: {
main: theme.gsc.red,
},
background: {
default: theme.gsc.offwhite,
paper: theme.gsc.white,
},
}, },
error: { typography: {
main: "#e40426", fontFamily: [
'"Helvetica Neue"',
"Arial",
"sans-serif",
"-apple-system",
"BlinkMacSystemFont",
'"Segoe UI"',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(","),
h1: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h2: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h3: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h4: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h5: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h6: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
button: {
textTransform: "none",
},
}, },
background: { })
default: "#f1f4f5", );
paper: "#ffffff",
},
},
typography: {
useNextVariants: true,
fontFamily: [
'"Helvetica Neue"',
"Arial",
"sans-serif",
"-apple-system",
"BlinkMacSystemFont",
'"Segoe UI"',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(","),
h1: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h2: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h3: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h4: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h5: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
h6: {
fontFamily: "ProximaNova",
fontWeight: 600,
},
button: {
textTransform: "none",
},
buttonNext: {
textTransform: "none",
},
},
});
const GSCMaterial = props => ( const GSCMaterial = props => (
<MuiThemeProvider theme={GSCTheme}> <MuiThemeProvider theme={GSCTheme}>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment