Skip to content

Commit

Permalink
Merge pull request #1610 from gluestack/release/@gluestack-style/reac…
Browse files Browse the repository at this point in the history
…t@1.0.35

Release/@gluestack style/react@1.0.35
  • Loading branch information
ankit-tailor authored Jan 11, 2024
2 parents 21d1d34 + 6cf0640 commit d5c5eb7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/styled/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @gluestack-style/react

## 1.0.35

### Patch Changes

- - Fixed nested provider color mode class

## 1.0.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gluestack-style/react",
"description": "A universal & performant styling library for React Native, Next.js & React",
"version": "1.0.34",
"version": "1.0.35",
"keywords": [
"React Native",
"Next.js",
Expand Down
10 changes: 7 additions & 3 deletions packages/styled/react/src/StyledProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ export const StyledProvider: React.FC<{
if (currentColorMode) {
if (!isParentProviderExist) {
document.body.setAttribute('data-theme-id', currentColorMode);
documentElement.classList.add(`gs-${currentColorMode}`);
}
documentElement.classList.add(`gs-${currentColorMode}`);
} else {
documentElement.classList.add(`gs-light`);
if (!isParentProviderExist) {
documentElement.classList.add(`gs-light`);
}
}
}

Expand All @@ -165,7 +167,9 @@ export const StyledProvider: React.FC<{
}
documentElement.classList.remove(`gs-dark`);
}
documentElement.classList.add(`gs-${currentColor}`);
if (!isParentProviderExist) {
documentElement.classList.add(`gs-${currentColor}`);
}
}
}
}
Expand Down

0 comments on commit d5c5eb7

Please sign in to comment.