From 9b434ceaba018b1749ec5fc1a2e129d641fd7dda Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sun, 21 Apr 2019 12:08:37 +0200 Subject: [PATCH 1/7] add themes to the tests tab --- .../Tests/TestDetails/ErrorDetails/index.tsx | 18 ++--- .../TestBlock/TestName/elements.ts | 12 ++- .../Tests/TestDetails/TestBlock/elements.ts | 12 +-- .../Tests/TestDetails/TestBlock/index.tsx | 1 + .../DevTools/Tests/TestDetails/elements.ts | 10 ++- .../DevTools/Tests/TestDetails/index.tsx | 1 + .../DevTools/Tests/TestElement/elements.ts | 74 ++++++++++++------- .../DevTools/Tests/TestElement/index.tsx | 1 + .../DevTools/Tests/TestOverview/elements.ts | 4 +- .../Tests/TestProgressBar/elements.ts | 5 +- .../DevTools/Tests/TestSummary/elements.ts | 25 +++++-- .../DevTools/Tests/TestSummary/index.tsx | 9 +-- .../Tests/TestSummaryText/elements.ts | 3 +- .../Preview/DevTools/Tests/elements.ts | 13 ++-- 14 files changed, 114 insertions(+), 74 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx index d4df83394fa..f6f4b2de1d5 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx @@ -12,14 +12,11 @@ const Container = styled.div` font-size: 0.875rem; line-height: 1.6; - color: rgba(255, 255, 255, 0.8); - - background-color: rgba(0, 0, 0, 0.5); - + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + background-color: ${props => props.theme['sideBar.background']}; white-space: pre-wrap; - border-bottom: 1px solid rgba(0, 0, 0, 0.5); - &:last-child { border-bottom: none; } @@ -33,15 +30,12 @@ function escapeHtml(unsafe) { .replace(/"/g, '"') .replace(/'/g, '''); } - -const white = 'rgba(255, 255, 255, 0.8)'; +const white = theme['sideBar.foreground']; const formatDiffMessage = (error: TestError, path: string) => { let finalMessage: string = ''; if (error.matcherResult) { - finalMessage = `${escapeHtml( - error.message - ) + finalMessage = `${escapeHtml(error.message) .replace(/(expected)/m, `$1`) .replace(/(received)/m, `$1`) .replace(/(Difference:)/m, `$1`) @@ -96,7 +90,7 @@ const formatDiffMessage = (error: TestError, path: string) => { finalMessage += `
` + (code.highlight diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts index 7d5ba25f9bd..fcdd7caf50a 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts @@ -7,7 +7,8 @@ export const Block = styled.div<{ last: boolean }>` padding-left: 0.5rem; position: relative; margin-right: ${props => (props.last ? 0 : 12)}px; - color: rgba(255, 255, 255, 0.5); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; white-space: nowrap; @@ -20,10 +21,6 @@ export const Block = styled.div<{ last: boolean }>` width: 24px; height: 24px; transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -o-transform: rotate(45deg); - -ms-transform: rotate(45deg); border-right: 1px solid rgba(0, 0, 0, ${props => (props.last ? 0.3 : 0.4)}); border-top: 1px solid rgba(0, 0, 0, ${props => (props.last ? 0.3 : 0.4)}); background-color: #181b1d; @@ -35,8 +32,9 @@ export const TestName = styled.div` transition: 0.3s ease background-color; padding: 0.4rem; padding-left: 20px; - background-color: ${props => props.theme.background2}; - color: rgba(255, 255, 255, 0.8); + background-color: ${props => props.theme['sideBar.background']}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; flex: auto; white-space: nowrap; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts index c44c9c8df10..4950b8746ef 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts @@ -7,7 +7,6 @@ export const BlockHeader = styled.div` box-sizing: border-box; padding: 0 0.5rem; padding-right: 2px; - background-color: #191c1d; overflow: hidden; `; @@ -22,19 +21,22 @@ export const Actions = styled.div` display: flex; align-items: center; padding: 7px; - background-color: ${props => props.theme.background2}; + background-color: ${props => props.theme['sideBar.background']}; font-size: 0.875rem; - color: rgba(255, 255, 255, 0.5); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + svg { transition: 0.3s ease color; margin-right: 1rem; font-size: 1.125rem; cursor: pointer; - + color: ${props => props.theme['button.hoverBackground']}; + opacity: 0.8; &:hover { - color: white; + opacity: 1; } } `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx index fc2ca674d1a..9386268b02b 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx @@ -8,6 +8,7 @@ import { Test } from '../../'; import { BlockHeader, Container, Actions } from './elements'; import TestName from './TestName'; import ErrorDetails from '../ErrorDetails'; +import theme from '@codesandbox/common/lib/theme'; type Props = { test: Test; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts index 3480a03e6d9..bb8678f9b30 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts @@ -18,6 +18,10 @@ export const Action = styled.div` opacity: 0.7; cursor: pointer; + svg { + color: ${props => props.theme['button.hoverBackground']}; + } + &:hover { opacity: 1; } @@ -28,14 +32,14 @@ export const Action = styled.div` `; export const ErrorNotice = styled.div` - color: rgba(255, 255, 255, 0.5); + color:${props => props.theme['sideBar.foreground']}; font-weight: 500; `; export const TestName = styled.span` font-weight: 400; font-size: 1rem; - color: white; + color:${props => props.theme['sideBar.foreground']}; margin: 0; margin-top: 0; margin-bottom: 0; @@ -44,5 +48,5 @@ export const TestName = styled.span` export const Blocks = styled.span` font-size: 1rem; font-weight: 300; - color: rgba(255, 255, 255, 0.7); + color:${props => props.theme['sideBar.foreground']} `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx index 80f43280a12..e082daf4e39 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx @@ -13,6 +13,7 @@ import TestBlock from './TestBlock'; import ErrorDetails from './ErrorDetails'; import TestSummaryText from '../TestSummaryText'; import TestProgressBar from '../TestProgressBar'; +import theme from '@codesandbox/common/lib/theme'; type Props = { file: File; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts index 5987a3070eb..04d5c85908f 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts @@ -6,16 +6,17 @@ export const Actions = styled.div` opacity: 0; font-size: 1.125rem; - color: white; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; svg { margin-left: 0.5rem; transition: 0.3s ease color; - - color: rgba(255, 255, 255, 0.6); + opacity: 0.8; + color: ${props => props.theme['button.hoverBackground']}; &:hover { - color: rgba(255, 255, 255, 1); + opacity: 1; } } `; @@ -24,8 +25,9 @@ export const TestName = styled.div` transition: 0.3s ease background-color; padding: 0.25rem; padding-left: 20px; - background-color: ${props => props.theme.background2}; - color: rgba(255, 255, 255, 0.8); + background-color: ${props => props.theme['sideBar.background']}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; flex: auto; white-space: nowrap; `; @@ -36,12 +38,11 @@ export const Test = styled.div<{ status: Status }>` padding-left: 1rem; cursor: pointer; - background-color: #181b1d; - ${props => props.status === 'idle' && css` - color: rgba(255, 255, 255, 0.4); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; `}; `; @@ -52,7 +53,8 @@ export const Block = styled.div<{ last: boolean }>` padding-left: 0.5rem; position: relative; margin-right: ${props => (props.last ? 0 : 12)}px; - color: rgba(255, 255, 255, 0.5); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; white-space: nowrap; @@ -65,13 +67,13 @@ export const Block = styled.div<{ last: boolean }>` width: 17px; height: 17px; transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -o-transform: rotate(45deg); - -ms-transform: rotate(45deg); - border-right: 2px solid rgba(0, 0, 0, 0.2); - border-top: 2px solid rgba(0, 0, 0, 0.2); - background-color: #181b1d; + border-right: 2px solid + ${props => + !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; + border-right: 2px solid + ${props => + !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; + background-color: ${props => props.theme['button.hoverBackground']}; z-index: 1; } `; @@ -86,18 +88,21 @@ export const FileData = styled.div` `; export const Path = styled.span` - color: rgba(255, 255, 255, 0.6); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; `; export const FileName = styled.span` - color: rgba(255, 255, 255, 0.8); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; flex: 1; `; export const Tests = styled.div` font-weight: 400; - color: rgba(255, 255, 255, 0.7); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; overflow-x: auto; &::-webkit-scrollbar { @@ -113,7 +118,10 @@ export const Container = styled.div<{ selected: boolean }>` border-left: 2px solid transparent; &:hover { - background-color: rgba(0, 0, 0, 0.2); + background-color: ${props => + !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; border-left-color: ${props => props.theme.secondary.clearer(0.5)}; ${Actions} { @@ -122,11 +130,11 @@ export const Container = styled.div<{ selected: boolean }>` ${Test} { ${TestName} { - background-color: rgba(0, 0, 0, 0.05); } ${Block} { - color: rgba(255, 255, 255, 0.8); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; } } } @@ -135,21 +143,33 @@ export const Container = styled.div<{ selected: boolean }>` props.selected && css` border-left-color: ${props.theme.secondary}; - background-color: rgba(0, 0, 0, 0.3); + background-color: ${props => + !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; ${Test} { ${TestName} { - background-color: rgba(0, 0, 0, 0.05); + background-color: ${props => + !props.theme.light + ? 'rgba(0, 0, 0, 0.2)' + : 'rgba(255, 255, 255, 0.2)'}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; } ${Block} { - color: rgba(255, 255, 255, 0.8); + background-color: ${props => + !props.theme.light + ? 'rgba(0, 0, 0, 0.2)' + : 'rgba(255, 255, 255, 0.2)'}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; } } &:hover { border-left-color: ${props.theme.secondary}; - background-color: rgba(0, 0, 0, 0.3); } `}; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx index a51d4c4bbf3..43e015c4205 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx @@ -23,6 +23,7 @@ import { } from './elements'; import { StatusElements } from '../elements'; +import theme from '@codesandbox/common/lib/theme'; type Props = { file: File; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts index 6ae8b809872..3b875853867 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts @@ -16,7 +16,9 @@ export const Item = styled.div` export const ItemTitle = styled.div` font-size: 1rem; font-weight: 500; - color: rgba(255, 255, 255, 0.5); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + opacity: 0.8; `; export const TestStatus = styled.div` diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts index 9258bf88961..8c1ec09b922 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts @@ -16,7 +16,6 @@ const BaseBar = styled.div<{ count: number }>` height: 3px; flex: ${props => props.count}; margin: 0 ${props => (props.count !== 0 ? 3 : 0)}px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); `; export const SuccessBar = styled(BaseBar)` @@ -28,5 +27,7 @@ export const FailedBar = styled(BaseBar)` `; export const IdleBar = styled(BaseBar)` - background-color: rgba(255, 255, 255, 0.5); + background-color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + opacity: 0.6; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts index 338de439669..020571ebd9d 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts @@ -1,5 +1,6 @@ -import styled from 'styled-components'; +import styled, { css } from 'styled-components'; +import SyncIcon from 'react-icons/lib/go/sync'; export const Container = styled.div` display: flex; @@ -10,7 +11,8 @@ export const Title = styled.div` align-items: center; font-weight: 600; font-size: 1rem; - color: rgba(255, 255, 255, 0.4); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; width: 100%; `; @@ -18,7 +20,8 @@ export const Progress = styled.div` display: flex; width: 100%; height: 2px; - background-color: rgba(0, 0, 0, 0.3); + background-color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.3)' : 'rgba(255, 255, 255, 0.3)'}; `; const Bar = styled.div<{ count: number }>` @@ -37,7 +40,9 @@ export const FailBar = styled(Bar)` `; export const IdleBar = styled(Bar)` - background-color: rgba(255, 255, 255, 0.5); + background-color: ${props => + !props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + opacity: 0.6; `; export const TestData = styled.div` @@ -45,6 +50,14 @@ export const TestData = styled.div` font-size: 0.875rem; `; +export const SyncIconStyled = styled(SyncIcon) <{ watching: boolean }>` + opacity: 0.7; + color: ${props => props.theme['button.hoverBackground']}; + ${props => props.watching && css` + opacity: 1; + `} +` + export const Actions = styled.div` display: flex; align-items: center; @@ -54,11 +67,13 @@ export const Actions = styled.div` svg { transition: 0.3s ease color; cursor: pointer; + color: ${props => props.theme['button.hoverBackground']}; margin-left: 0.5rem; &:hover { - color: white; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; } } `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx index 5c1e9bd1c0f..55b7187be2f 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx @@ -1,8 +1,7 @@ // @flow import * as React from 'react'; import PlayIcon from 'react-icons/lib/go/playback-play'; -import SyncIcon from 'react-icons/lib/go/sync'; - +import theme from '@codesandbox/common/lib/theme'; import Tooltip from '@codesandbox/common/lib/components/Tooltip'; import { File, Test, Status } from '../'; @@ -16,6 +15,7 @@ import { TestData, IdleBar, Actions, + SyncIconStyled, } from './elements'; import TestSummaryText from '../TestSummaryText'; @@ -69,10 +69,7 @@ export default ({ {totalTestCount !== 0 && `${totalDuration}ms`}
- + diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts index fdc134c1a48..bc309f51fdc 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts @@ -27,7 +27,8 @@ export const FailedTests = styled.div` export const TotalTests = styled.div` ${baseTestStyles}; - color: rgba(255, 255, 255, 0.5); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; `; export const RightSide = styled.div` diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts index 96ad4f7a5ad..2200490007e 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts @@ -10,8 +10,9 @@ export const Container = styled.div` width: 100%; height: 100%; - background-color: ${props => props.theme.background4}; - color: rgba(255, 255, 255, 0.8); + background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; `; export const Navigation = styled.div` @@ -23,13 +24,13 @@ export const Navigation = styled.div` `; export const TestContainer = styled(Navigation)` - background-color: ${props => props.theme.background2}; + background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; height: 100%; `; export const TestDetails = styled.div` flex: 3; - background-color: ${props => props.theme.background}; + background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; height: 100%; `; @@ -56,7 +57,9 @@ export const Fail = styled(Cross)` export const Dot = styled(DotIcon)` ${iconStyles}; - color: rgba(255, 255, 255, 0.3); + color: ${props => + props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + opacity: 0.3; `; export const StatusElements = { From 6c6169bd5fa75a3aae8f9f1c5ca12343f26c49d3 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sun, 21 Apr 2019 12:18:22 +0200 Subject: [PATCH 2/7] clea clors --- .../Tests/TestDetails/TestBlock/elements.ts | 2 +- .../DevTools/Tests/TestDetails/TestBlock/index.tsx | 1 - .../Preview/DevTools/Tests/TestDetails/elements.ts | 2 ++ .../Preview/DevTools/Tests/TestDetails/index.tsx | 1 - .../Preview/DevTools/Tests/TestElement/elements.ts | 14 +++++++------- .../Preview/DevTools/Tests/TestElement/index.tsx | 1 - .../DevTools/Tests/TestOverview/elements.ts | 3 +-- .../DevTools/Tests/TestProgressBar/elements.ts | 3 +-- .../Preview/DevTools/Tests/TestSummary/elements.ts | 6 +++--- .../Preview/DevTools/Tests/TestSummary/index.tsx | 1 - .../DevTools/Tests/TestSummaryText/elements.ts | 2 +- .../components/Preview/DevTools/Tests/elements.ts | 11 +++++------ 12 files changed, 21 insertions(+), 26 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts index 4950b8746ef..a0a420b0e74 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts @@ -25,7 +25,7 @@ export const Actions = styled.div` font-size: 0.875rem; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; svg { diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx index 9386268b02b..fc2ca674d1a 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/index.tsx @@ -8,7 +8,6 @@ import { Test } from '../../'; import { BlockHeader, Container, Actions } from './elements'; import TestName from './TestName'; import ErrorDetails from '../ErrorDetails'; -import theme from '@codesandbox/common/lib/theme'; type Props = { test: Test; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts index bb8678f9b30..889114ea426 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts @@ -32,6 +32,7 @@ export const Action = styled.div` `; export const ErrorNotice = styled.div` + opacity: 0.5; color:${props => props.theme['sideBar.foreground']}; font-weight: 500; `; @@ -48,5 +49,6 @@ export const TestName = styled.span` export const Blocks = styled.span` font-size: 1rem; font-weight: 300; + opacity: 0.7; color:${props => props.theme['sideBar.foreground']} `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx index e082daf4e39..80f43280a12 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/index.tsx @@ -13,7 +13,6 @@ import TestBlock from './TestBlock'; import ErrorDetails from './ErrorDetails'; import TestSummaryText from '../TestSummaryText'; import TestProgressBar from '../TestProgressBar'; -import theme from '@codesandbox/common/lib/theme'; type Props = { file: File; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts index 04d5c85908f..03254360a6f 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts @@ -7,12 +7,12 @@ export const Actions = styled.div` font-size: 1.125rem; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgb(0, 0, 0)' : 'rgb(255, 255, 255)'}; svg { margin-left: 0.5rem; transition: 0.3s ease color; - opacity: 0.8; + opacity: 0.6; color: ${props => props.theme['button.hoverBackground']}; &:hover { @@ -27,7 +27,7 @@ export const TestName = styled.div` padding-left: 20px; background-color: ${props => props.theme['sideBar.background']}; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; flex: auto; white-space: nowrap; `; @@ -42,7 +42,7 @@ export const Test = styled.div<{ status: Status }>` props.status === 'idle' && css` color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.4)' : 'rgba(255, 255, 255, 0.4)'}; `}; `; @@ -54,7 +54,7 @@ export const Block = styled.div<{ last: boolean }>` position: relative; margin-right: ${props => (props.last ? 0 : 12)}px; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; white-space: nowrap; @@ -89,12 +89,12 @@ export const FileData = styled.div` export const Path = styled.span` color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.6)' : 'rgba(255, 255, 255, 0.6)'}; `; export const FileName = styled.span` color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; flex: 1; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx index 43e015c4205..a51d4c4bbf3 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/index.tsx @@ -23,7 +23,6 @@ import { } from './elements'; import { StatusElements } from '../elements'; -import theme from '@codesandbox/common/lib/theme'; type Props = { file: File; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts index 3b875853867..01958825c18 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts @@ -17,8 +17,7 @@ export const ItemTitle = styled.div` font-size: 1rem; font-weight: 500; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; - opacity: 0.8; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; `; export const TestStatus = styled.div` diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts index 8c1ec09b922..1d93beb0da8 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts @@ -28,6 +28,5 @@ export const FailedBar = styled(BaseBar)` export const IdleBar = styled(BaseBar)` background-color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; - opacity: 0.6; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts index 020571ebd9d..45ae50854a8 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts @@ -12,7 +12,7 @@ export const Title = styled.div` font-weight: 600; font-size: 1rem; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.4)' : 'rgba(255, 255, 255, 0.4)'}; width: 100%; `; @@ -41,7 +41,7 @@ export const FailBar = styled(Bar)` export const IdleBar = styled(Bar)` background-color: ${props => - !props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + !props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; opacity: 0.6; `; @@ -73,7 +73,7 @@ export const Actions = styled.div` &:hover { color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; } } `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx index 55b7187be2f..bde48de5cab 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/index.tsx @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; import PlayIcon from 'react-icons/lib/go/playback-play'; -import theme from '@codesandbox/common/lib/theme'; import Tooltip from '@codesandbox/common/lib/components/Tooltip'; import { File, Test, Status } from '../'; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts index bc309f51fdc..b81f75d2d20 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummaryText/elements.ts @@ -28,7 +28,7 @@ export const FailedTests = styled.div` export const TotalTests = styled.div` ${baseTestStyles}; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; `; export const RightSide = styled.div` diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts index 2200490007e..e81206dd490 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/elements.ts @@ -10,9 +10,9 @@ export const Container = styled.div` width: 100%; height: 100%; - background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; + background-color: ${props => props.theme['sideBar.background']}; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; `; export const Navigation = styled.div` @@ -24,13 +24,13 @@ export const Navigation = styled.div` `; export const TestContainer = styled(Navigation)` - background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; + background-color: ${props => props.theme['sideBar.background']}; height: 100%; `; export const TestDetails = styled.div` flex: 3; - background-color: ${props => props.theme['sideBar.background'] || 'inherit'}; + background-color: ${props => props.theme['sideBar.background']}; height: 100%; `; @@ -58,8 +58,7 @@ export const Fail = styled(Cross)` export const Dot = styled(DotIcon)` ${iconStyles}; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; - opacity: 0.3; + props.theme.light ? 'rgba(0, 0, 0, 0.3)' : 'rgba(255, 255, 255, 0.3)'}; `; export const StatusElements = { From 580808101660c126ee3f32272e1a7ca2a0a01649 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sun, 21 Apr 2019 12:35:47 +0200 Subject: [PATCH 3/7] clean more colors --- .../Tests/TestDetails/ErrorDetails/index.tsx | 17 ++++++----------- .../TestDetails/TestBlock/TestName/elements.ts | 6 ++---- .../Tests/TestDetails/TestBlock/elements.ts | 2 +- .../DevTools/Tests/TestDetails/elements.ts | 2 +- .../DevTools/Tests/TestElement/elements.ts | 4 +--- .../DevTools/Tests/TestOverview/elements.ts | 1 + .../DevTools/Tests/TestProgressBar/elements.ts | 1 - .../DevTools/Tests/TestSummary/elements.ts | 7 +++---- 8 files changed, 15 insertions(+), 25 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx index f6f4b2de1d5..f3bd04948e9 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/ErrorDetails/index.tsx @@ -13,7 +13,7 @@ const Container = styled.div` line-height: 1.6; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; background-color: ${props => props.theme['sideBar.background']}; white-space: pre-wrap; @@ -30,22 +30,21 @@ function escapeHtml(unsafe) { .replace(/"/g, '"') .replace(/'/g, '''); } -const white = theme['sideBar.foreground']; const formatDiffMessage = (error: TestError, path: string) => { let finalMessage: string = ''; if (error.matcherResult) { - finalMessage = `${escapeHtml(error.message) + finalMessage = `${escapeHtml(error.message) .replace(/(expected)/m, `$1`) .replace(/(received)/m, `$1`) - .replace(/(Difference:)/m, `$1`) + .replace(/(Difference:)/m, `$1`) .replace( /(Expected.*\n)(.*)/m, - `$1$2` + `$1$2` ) .replace( /(Received.*\n)(.*)/m, - `$1$2` + `$1$2` ) .replace(/^(-.*)/gm, `$1`) .replace( @@ -88,11 +87,7 @@ const formatDiffMessage = (error: TestError, path: string) => { } finalMessage += - `
` + + `
` + (code.highlight ? `> ` : '') + diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts index fcdd7caf50a..e65a13db25b 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts @@ -1,14 +1,13 @@ import styled from 'styled-components'; export const Block = styled.div<{ last: boolean }>` - transition: 0.3s ease color; display: flex; padding: 0.5rem 0.4rem; padding-left: 0.5rem; position: relative; margin-right: ${props => (props.last ? 0 : 12)}px; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.5)'}; white-space: nowrap; @@ -29,12 +28,11 @@ export const Block = styled.div<{ last: boolean }>` `; export const TestName = styled.div` - transition: 0.3s ease background-color; padding: 0.4rem; padding-left: 20px; background-color: ${props => props.theme['sideBar.background']}; color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 0.7)' : 'rgba(255, 255, 255, 0.7)'}; + props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; flex: auto; white-space: nowrap; `; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts index a0a420b0e74..0401f37e8c9 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts @@ -29,7 +29,7 @@ export const Actions = styled.div` svg { - transition: 0.3s ease color; + transition: 0.3s ease opacity; margin-right: 1rem; font-size: 1.125rem; cursor: pointer; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts index 889114ea426..0f2093cb4d3 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/elements.ts @@ -19,7 +19,7 @@ export const Action = styled.div` cursor: pointer; svg { - color: ${props => props.theme['button.hoverBackground']}; + color: ${props => props.theme['button.hoverBackground']}; } &:hover { diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts index 03254360a6f..b4ee36fed39 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts @@ -11,7 +11,7 @@ export const Actions = styled.div` svg { margin-left: 0.5rem; - transition: 0.3s ease color; + transition: 0.3s ease opacity; opacity: 0.6; color: ${props => props.theme['button.hoverBackground']}; @@ -22,7 +22,6 @@ export const Actions = styled.div` `; export const TestName = styled.div` - transition: 0.3s ease background-color; padding: 0.25rem; padding-left: 20px; background-color: ${props => props.theme['sideBar.background']}; @@ -47,7 +46,6 @@ export const Test = styled.div<{ status: Status }>` `; export const Block = styled.div<{ last: boolean }>` - transition: 0.3s ease color; display: flex; padding: 0.25rem 0.4rem; padding-left: 0.5rem; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts index 01958825c18..f373939a643 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestOverview/elements.ts @@ -3,6 +3,7 @@ import styled from 'styled-components'; export const Container = styled.div` position: relative; height: 100%; + border-top: 2px solid ${props => props.theme['panel.border']} `; export const Item = styled.div` diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts index 1d93beb0da8..3b469622206 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestProgressBar/elements.ts @@ -11,7 +11,6 @@ export const ProgressBar = styled.div` `; const BaseBar = styled.div<{ count: number }>` - transition: 0.3s ease all; border-radius: 1px; height: 3px; flex: ${props => props.count}; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts index 45ae50854a8..ec491b54064 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestSummary/elements.ts @@ -25,7 +25,6 @@ export const Progress = styled.div` `; const Bar = styled.div<{ count: number }>` - transition: 0.3s ease all; flex: ${props => props.count}; width: 100%; height: 100%; @@ -65,15 +64,15 @@ export const Actions = styled.div` font-size: 1.125rem; svg { - transition: 0.3s ease color; + transition: 0.3s ease opacity; cursor: pointer; + opacity: 0.8; color: ${props => props.theme['button.hoverBackground']}; margin-left: 0.5rem; &:hover { - color: ${props => - props.theme.light ? 'rgba(0, 0, 0, 1)' : 'rgba(255, 255, 255, 1)'}; + opacity: 1; } } `; From 8adc91f38eddd65de6876895ea911d31eba5589d Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sun, 21 Apr 2019 16:46:35 +0200 Subject: [PATCH 4/7] fix arrows --- .../TestDetails/TestBlock/TestName/elements.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts index e65a13db25b..e9b6b41aa34 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts @@ -15,14 +15,16 @@ export const Block = styled.div<{ last: boolean }>` content: ''; position: absolute; margin: auto; - top: 5px; + top: 12px; right: -10px; - width: 24px; - height: 24px; + width: 10px; + height: 10px; transform: rotate(45deg); - border-right: 1px solid rgba(0, 0, 0, ${props => (props.last ? 0.3 : 0.4)}); - border-top: 1px solid rgba(0, 0, 0, ${props => (props.last ? 0.3 : 0.4)}); - background-color: #181b1d; + border-right: 1px solid ${props => + props.theme.light ? `rgba(0, 0, 0, ${(props.last ? 0.3 : 0.4)})` : `rgba(255, 255, 255, ${(props.last ? 0.3 : 0.4)})`}; + border-top: 1px solid ${props => + props.theme.light ? `rgba(0, 0, 0, ${(props.last ? 0.3 : 0.4)})` : `rgba(255, 255, 255, ${(props.last ? 0.3 : 0.4)})`}; + background-color: rgba(0, 0, 0, 0.01); z-index: 1; } `; From 3983f68ebaa74d1811b30cf5c32e838f54fa081e Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Sun, 21 Apr 2019 16:56:21 +0200 Subject: [PATCH 5/7] fix other arrow --- .../DevTools/Tests/TestElement/elements.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts index b4ee36fed39..05dda690662 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestElement/elements.ts @@ -59,20 +59,15 @@ export const Block = styled.div<{ last: boolean }>` &::after { content: ''; position: absolute; - margin: auto; - top: 3px; + top: 8px; right: -10px; - width: 17px; - height: 17px; + width: 10px; + height: 10px; transform: rotate(45deg); - border-right: 2px solid - ${props => - !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; - border-right: 2px solid - ${props => - !props.theme.light ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)'}; - background-color: ${props => props.theme['button.hoverBackground']}; - z-index: 1; + border-right: 1px solid ${props => + props.theme.light ? `rgba(0, 0, 0, ${(props.last ? 0.3 : 0.4)})` : `rgba(255, 255, 255, ${(props.last ? 0.3 : 0.4)})`}; + border-top: 1px solid ${props => + props.theme.light ? `rgba(0, 0, 0, ${(props.last ? 0.3 : 0.4)})` : `rgba(255, 255, 255, ${(props.last ? 0.3 : 0.4)})`}; } `; From 3e0d0dd2c367e1e8f5569e45a14fb7b428064005 Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Mon, 29 Apr 2019 11:14:58 +0200 Subject: [PATCH 6/7] Use jsdom instead of window in jest test (#1812) * Hacky implementation of jsdom inside jest tests * Update path to jsdom * Properly set globals according to jest defaults * Properly set global to jsdom window * Make globals dynamic * Improve scrolling of tests view * Proper fix for the styling of tests * Convert jest-lite to typescript * Fix scrolling for the full test details * Deduplicate Tests container * Properly mark errors as jest errors, clear them on new start * Move clear error to less spammy place * Fix error loading later on in the editor --- packages/app/src/sandbox/eval/tests/jest-lite.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/sandbox/eval/tests/jest-lite.ts b/packages/app/src/sandbox/eval/tests/jest-lite.ts index 843531cceb8..8b85f3b750d 100644 --- a/packages/app/src/sandbox/eval/tests/jest-lite.ts +++ b/packages/app/src/sandbox/eval/tests/jest-lite.ts @@ -423,4 +423,4 @@ export default class TestRunner { // We stub this, because old versions of CodeSandbox still needs this reportError = () => {}; -} +} \ No newline at end of file From e016803721fada2b0819f98bed22b6feec5a0d29 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Tue, 30 Apr 2019 12:15:12 +0200 Subject: [PATCH 7/7] add bg --- .../TestDetails/TestBlock/TestName/elements.ts | 7 +++---- .../Tests/TestDetails/TestBlock/elements.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts index e9b6b41aa34..3f6abbf8d23 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/TestName/elements.ts @@ -15,10 +15,10 @@ export const Block = styled.div<{ last: boolean }>` content: ''; position: absolute; margin: auto; - top: 12px; + top: 13px; right: -10px; - width: 10px; - height: 10px; + width: 8px; + height: 8px; transform: rotate(45deg); border-right: 1px solid ${props => props.theme.light ? `rgba(0, 0, 0, ${(props.last ? 0.3 : 0.4)})` : `rgba(255, 255, 255, ${(props.last ? 0.3 : 0.4)})`}; @@ -32,7 +32,6 @@ export const Block = styled.div<{ last: boolean }>` export const TestName = styled.div` padding: 0.4rem; padding-left: 20px; - background-color: ${props => props.theme['sideBar.background']}; color: ${props => props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'}; flex: auto; diff --git a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts index 0401f37e8c9..d3ba0e0dd95 100644 --- a/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts +++ b/packages/app/src/app/components/Preview/DevTools/Tests/TestDetails/TestBlock/elements.ts @@ -1,17 +1,22 @@ import styled from 'styled-components'; +import Color from 'color' export const BlockHeader = styled.div` display: flex; align-items: center; width: 100%; box-sizing: border-box; - padding: 0 0.5rem; - padding-right: 2px; + padding: 0rem 1rem; + overflow: hidden; + background-color: ${props => Color(props.theme['sideBar.background']) + .darken(props.theme.light ? 0.1 : 0.3) + .rgbString()}; `; + export const Container = styled.div` - margin-bottom: 1rem; + margin-bottom: 0.75rem; overflow: hidden; border-radius: 2px; @@ -21,7 +26,7 @@ export const Actions = styled.div` display: flex; align-items: center; padding: 7px; - background-color: ${props => props.theme['sideBar.background']}; + padding-right: 0; font-size: 0.875rem; color: ${props =>