3.2.0 • Published 6 months ago

@zooniverse/grommet-theme v3.2.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 months ago

Zooniverse Grommet Theme

A Zooniverse theme for the Grommet 2.0 React component library. Zooniverse brand.

Usage

To use this theme, import it and pass it as a prop to the top-level Grommet component:

import { Button, Grommet, base as baseTheme } from 'grommet'
import React from 'react'
import merge from 'lodash/merge'
import zooTheme from '@zooniverse/grommet-theme'

class MyComponent extends React.Component {
  // Deep merging the base and new theme is recommended by the Grommet team
  // Use which ever deep merge function you'd like
  const mergedTheme = merge({}, baseTheme, zooTheme)
  render() {
    return (
      <Grommet theme={mergedTheme}>
        <Button color='brand' label='Click me!' />
      </Grommet>
    )
  }
}

Theme colors

Zooniverse brand colors map to the following variable names in the theme:

theme variablehexcolor
accent-1#addde0npm.io
accent-2#f6d885npm.io
accent-3#B8E986npm.io
accent-4#FFB6AAnpm.io
brand#00979dnpm.io
dark-1#2D2D2Dnpm.io
dark-2#272727npm.io
dark-3#333333npm.io
dark-4#404040npm.io
dark-5#5C5C5Cnpm.io
dark-6#666666npm.io
drawing-red#FF3C25npm.io
drawing-orange#FF9300npm.io
drawing-yellow#FFFF03npm.io
drawing-green#06FE76npm.io
drawing-aqua#0CFFE0npm.io
drawing-blue#235DFFnpm.io
drawing-pink#FF40FFnpm.io
drawing-ruby#FF2B70npm.io
highlighter-red#E65252npm.io
highlighter-orange#F1AE4Dnpm.io
highlighter-yellow#FCED54npm.io
highlighter-pink#EE7BCFnpm.io
highlighter-honeysuckle#C7F55Bnpm.io
highlighter-green#52DB72npm.io
highlighter-turquoise#65EECAnpm.io
highlighter-sky#7CDFF2npm.io
highlighter-blue#8AA0D3npm.io
highlighter-purple#C17DDFnpm.io
highlighter-plum#E7BBE3npm.io
light-1#eff2f5npm.io
light-2#ebebebnpm.io
light-3#e2e5e9npm.io
light-4#CBCCCBnpm.io
light-5#a6a7a9npm.io
light-6#979797npm.io
neutral-1#005D69npm.io
neutral-2#f0b200npm.io
neutral-3#1ED359npm.io
neutral-4#E45950npm.io
neutral-5#43BBFDnpm.io
neutral-6#ffffffnpm.io
neutral-7#000000npm.io
status-critical#E45950npm.io
status-error#FFB6AAnpm.io
status-warning#CC9200npm.io
status-ok#1ED359npm.io
status-unknown#CBCCCBnpm.io
status-disabled#CBCCCBnpm.io

Colors for components defaults, text, focus, placeholder, borders, etc are set from these in the theme. Additionally, any Grommet component that accepts a color for a prop can be passed in the variable name to set it, i.e. <Box background={{ light: 'dark-2', dark: 'light-2' }}>

Development

The conventions of the theme structure are based on Grommet's base theme: https://github.com/grommet/grommet/blob/master/src/js/themes/base.js

License

Copyright 2018 Zooniverse

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

3.2.0

6 months ago

3.1.1

1 year ago

3.1.0

2 years ago

3.0.0

3 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

0.0.1

6 years ago