question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grommet 'background' property not working

See original GitHub issue

I recently updated to Grommet 2.2.1 and now its not loading colors properly using the ‘background’ property.

Expected Behavior

import { Grommet, Box } from 'grommet';
import { grommet } from 'grommet/themes';

<Grommet theme={grommet}>
    <Box background="brand">
        test
    </Box>
</Grommet>

This should yield a purple box

Actual Behavior

Throws an “Uncaught TypeError: Cannot read property ‘colors’ of undefined”

Also when importing ‘grommet/themes’, VS code says: [ts] Could not find a declaration file for module ‘grommet/themes’.

  • Grommet version: ^2.2.1
  • Browser Name and version: Chrome Version 70.0.3538.102
  • Operating System and version (desktop or mobile): Mac Mojave, V10.14

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
alansouzaticommented, Dec 11, 2018

https://github.com/grommet/grommet/releases/tag/v2.2.0 <-- we describe the update process here

0reactions
alansouzaticommented, Dec 11, 2018

yeah sorry for the bumpy road there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show image as background in box in grommet - Stack Overflow
I have created a sandbox to showcase the problem. I have added a background.jpeg image locally which I am setting as the background...
Read more >
the top level grommet container
Either a color identifier to use for the background color. For example: 'neutral-1'. Or, a 'url()' for an image. Dark is not needed...
Read more >
Dark Mode Theming in Grommet: Theme color customization
Dark specifies the color Grommet uses when the element is on a dark background; light specifies the color for use on a light...
Read more >
Using Grommet In React Applications - Smashing Magazine
In this tutorial, we're going to learn how to use Grommet as a UI library ... and theme properties which we'd need as...
Read more >
The Grommet
No information is available for this page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found