Skip to content

Commit 21bab07

Browse files
SaraVieiraCompuIves
authored andcommitted
fix color (codesandbox#1776)
1 parent ca84dd6 commit 21bab07

File tree

1 file changed

+12
-2
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace

1 file changed

+12
-2
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/elements.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import fadeIn from '@codesandbox/common/lib/utils/animation/fade-in';
33

44
export const getContainerStyles = props => {
55
const { theme } = props;
6+
const getSelectedColor = activeColor => {
7+
// some have active as full white and should never be
8+
if (activeColor === '#ffffff') {
9+
return theme.light ? '#6c6c6c' : 'rgba(255, 255, 255, 0.5)';
10+
}
11+
12+
return activeColor || theme.white();
13+
};
14+
615
const color =
716
props.color ||
817
(props.alternative
@@ -68,8 +77,9 @@ export const getContainerStyles = props => {
6877

6978
if (props.active) {
7079
styles += `
71-
color: ${theme['list.activeSelectionForeground'] ||
72-
theme.white()} !important;
80+
color: ${getSelectedColor(
81+
theme['list.activeSelectionForeground']
82+
)} !important;
7383
border-color: ${color()} !important;
7484
background-color: ${color.lighten(0.1).clearer(0.8)()} !important;
7585
`;

0 commit comments

Comments
 (0)