Skip to content

Commit

Permalink
fix(cssvar): properly error when there is no document
Browse files Browse the repository at this point in the history
cssVar properly errors when no document object is present in non-browser environments.

fix #518
  • Loading branch information
bhough committed Jun 11, 2020
1 parent ae7454a commit b0a9571
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polished",
"version": "3.6.4",
"version": "3.6.5",
"description": "A lightweight toolset for writing styles in Javascript.",
"license": "MIT",
"author": "Brian Hough <hello@brianhough.net> (https://polished.js.org)",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/cssVar.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function cssVar(

/* eslint-disable */
/* istanbul ignore next */
if (document.documentElement !== null) {
if (typeof document !== 'undefined' && document.documentElement !== null) {
variableValue = getComputedStyle(document.documentElement).getPropertyValue(
cssVariable,
)
Expand Down

0 comments on commit b0a9571

Please sign in to comment.