Skip to content

Commit

Permalink
🐛 (js) Fix container color when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jul 6, 2023
1 parent 5a05310 commit aeb62f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.65",
"version": "0.0.66",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/embeds/js/src/utils/setCssVariablesValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@typebot.io/schemas'
import { BackgroundType } from '@typebot.io/schemas/features/typebot/theme/enums'
import { isLight, hexToRgb } from '@typebot.io/lib/hexToRgb'
import { isNotEmpty } from '@typebot.io/lib'

const cssVariableNames = {
general: {
Expand Down Expand Up @@ -37,6 +38,7 @@ const cssVariableNames = {
},
checkbox: {
bgColor: '--typebot-checkbox-bg-color',
color: '--typebot-checkbox-color',
},
},
} as const
Expand Down Expand Up @@ -155,7 +157,9 @@ const setTypebotBackground = (
parseBackgroundValue(background)
)
const backgroundColor =
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
(BackgroundType.COLOR && isNotEmpty(background.content)
? background.content
: '#ffffff') ?? '#ffffff'
documentStyle.setProperty(
cssVariableNames.chat.checkbox.bgColor,
(BackgroundType.COLOR ? background.content : '#ffffff') ?? '#ffffff'
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.65",
"version": "0.0.66",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit aeb62f9

Please sign in to comment.