Commit 828fdadb authored by Ben Galloway's avatar Ben Galloway

Initial commit for testing

parents
fonts
img
@font-face {
font-family: "ProximaNova";
font-style: normal;
font-weight: 300;
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.eot");
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.eot?#iefix")
format("embedded-opentype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.woff2") format("woff2"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.woff") format("woff"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.ttf") format("truetype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Light.svg#ProximaNova-Light")
format("svg");
}
@font-face {
font-family: "ProximaNova";
font-style: normal;
font-weight: 600;
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.eot");
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.eot?#iefix")
format("embedded-opentype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.woff2") format("woff2"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.woff") format("woff"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.ttf") format("truetype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-Semibold.svg#ProximaNova-Semibold")
format("svg");
}
@font-face {
font-family: "ProximaNova";
font-style: italic;
font-weight: 300;
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.eot");
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.eot?#iefix")
format("embedded-opentype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.woff2") format("woff2"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.woff") format("woff"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.ttf") format("truetype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-LightIt.svg#ProximaNova-LightIt")
format("svg");
}
@font-face {
font-family: "ProximaNova";
font-style: italic;
font-weight: 600;
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.eot");
src: url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.eot?#iefix")
format("embedded-opentype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.woff2") format("woff2"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.woff") format("woff"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.ttf") format("truetype"),
url("https://git.gsc.org.uk/utils/gsc-material/raw/master/fonts/ProximaNova-SemiboldIt.svg#ProximaNova-SemiboldIt")
format("svg");
}
# GSC Material
A simple theme implementation for [Material UI](https://material-ui.com/) which uses GSC colours and fonts.
## Using the Theme
Install the package with e.g.
```bash
yarn add react @material-ui/core git+https://git.gsc.org.uk/utils/gsc-material.git
```
Note that this depends on the `gsc-material` package being stored in a public Git repository.
Then simply wrap your app's main component with the `<GSCMaterial>` component. For example, in the `index.js` file generated by `create-react-app`, use something like:
```js
import React from "react";
import ReactDOM from "react-dom";
import GSCMaterial from "gsc-material";
import "gsc-material/ProximaNovaFontFace.css";
import App from "./App";
ReactDOM.render(
<GSCMaterial>
<App />
</GSCMaterial>,
document.getElementById("root")
);
```
## Adding Fonts
In a JavaScript app:
```js
import "gsc-material/ProximaNovaFontFace.css";
```
or, in plain HTML:
```html
<link rel="stylesheet" type="text/css" href="https://git.gsc.org.uk/utils/gsc-material/raw/master/ProximaNovaFontFace.css">
```
Note that the font files themselves are not distributed with the package - they are designed to be used directly from the Git repository, which again for this purpose must therefore be public.
## Images
GSC logos are stored in the `img` directory for posterity. These are also not distributed with the package.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
import React from "react";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
import { CssBaseline } from "@material-ui/core";
const GSCTheme = createMuiTheme({
palette: {
primary: {
main: "#2e2d44",
contrastText: "#f1f4f5",
},
secondary: {
main: "#30b7bb",
contrastText: "#2e2d44",
},
error: {
main: "#e40426",
},
background: {
default: "#f1f4f5",
paper: "#ffffff",
},
},
typography: {
fontFamily: [
'"Helvetica Neue"',
"Arial",
"sans-serif",
"-apple-system",
"BlinkMacSystemFont",
'"Segoe UI"',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(","),
useNextVariants: true,
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 => (
<MuiThemeProvider theme={GSCTheme}>
<CssBaseline />
{props.children}
</MuiThemeProvider>
);
export default GSCMaterial;
{
"name": "gsc-material",
"version": "1.0.0",
"description": "An implementation of Material-UI with GSC styling",
"main": "index.js",
"repository": "https://git.gsc.org.uk/utils/gsc-material.git",
"author": "Ben Galloway <ben.galloway@gsc.org.uk>",
"license": "MIT",
"private": true,
"peerDependencies": {
"react": "^16.5.2",
"@material-ui/core": "^3.3.0"
}
}
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