This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
feat: update styling of layout and element pane #393
Merged
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
ca2c1d9
feat(component): update styling of layout
b0cc943
feat(component): update styling of element pane
551ec59
feat: unselect items when sidebar root receives click
marionebl 71d38c9
refactor: simplify app view by moving out splashscreen
marionebl 744f262
Merge branch 'master' into feat/new-style
marionebl 76ac1ae
style: use tabs for indentation
marionebl 71c298d
feat(component): add drag image styling
42284b6
fixup! increase element drag size
c6c52ff
fixup! add check for null on drag element
4f6f148
fix: avoid side effect froms drop areas on click interaction
marionebl 686f264
fix: remove obsolete handler
marionebl 643d538
fix: select right drag element target
8904d0a
fix: adapt to new interface
marionebl 5500cbf
fix: make ts happy
marionebl 4fe6cbf
fix: restore icon click functionality
marionebl 9c223fc
feat: show either properties or patterns pane
marionebl 57208e6
fix: restore pattern drag
marionebl dbe48a1
fix: set backgroundColor during startup
c7de980
fix: handle draggable states via unified state
marionebl dd1a6c4
feat: add button to show pattern pane
marionebl f6212c4
feat: add button styling
4b084dd
Merge branch 'master' into feat/new-style
tilmx 9f9f31d
Merge branch 'master' into feat/new-style
marionebl 3b79de9
Merge branch 'master' into feat/new-style
marionebl 40a6397
fixup! change requests
05dd8a2
fix: pass hex color to BrowserWindow
marionebl ed39ced
refactor: use 100vh to move element outside of viewport
marionebl 70d4708
fix: clean up dragimg nodes after dragging
marionebl d8f8408
fix: get color from styleguide
0a20c6e
fix: read drag image colors from styleguide
c42f0e2
fix: update add button position and side bar borders
a192919
fix: set hover and active styling to preview resizer
344f2cb
fix: add element overflow gradient
a3b2dc8
fix: make entire tree element draggable
marionebl 0da7a7c
fix: reenable placeholder targets for off-list payloads
marionebl e5ea5f0
fix: do not write bogus dom attributes
marionebl 81a7e2a
Merge branch 'master' into feat/new-style
marionebl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,69 +45,116 @@ export interface StyledPlaceholder { | |
} | ||
|
||
const StyledElement = styled.div` | ||
cursor: default; | ||
position: relative; | ||
z-index: 1; | ||
`; | ||
|
||
const StyledElementLabel = styled.div` | ||
position: relative; | ||
display: flex; | ||
padding: 9px ${getSpace(Size.L)}px 9px ${getSpace(Size.XL)}px; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
padding: ${getSpace(Size.XS)}px ${getSpace(Size.L)}px ${getSpace(Size.XS)}px ${getSpace(Size.XXL)}px; | ||
align-items: center; | ||
color: ${colors.black.toString()}; | ||
color: ${colors.grey20.toString()}; | ||
position: relative; | ||
font-size: 15px; | ||
line-height: 21px; | ||
z-index: 1; | ||
|
||
&::before { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
height: 100%; | ||
width: 240px; | ||
left: 0; | ||
top: 0; | ||
margin-left: -240px; | ||
} | ||
|
||
&:hover { | ||
background: ${colors.grey90.toString()}; | ||
background ${colors.black.toString('rgb', { alpha: 0.05 })}; | ||
|
||
&::before { | ||
background: ${colors.black.toString('rgb', { alpha: 0.05 })}; | ||
} | ||
} | ||
|
||
${(props: StyledElementLabelProps) => | ||
props.active | ||
? ` | ||
color: ${colors.white.toString()}; | ||
background: ${colors.blue40.toString()}; | ||
color: ${colors.blue.toString()}; | ||
background: ${colors.blue80.toString()}; | ||
|
||
&::before { | ||
background: ${colors.blue80.toString()}; | ||
} | ||
|
||
&:hover { | ||
background: ${colors.blue40.toString()}; | ||
background: ${colors.blue80.toString()}; | ||
|
||
&::before { | ||
background: ${colors.blue80.toString()}; | ||
} | ||
} | ||
` | ||
: ''}; | ||
${(props: StyledElementLabelProps) => | ||
props.highlight | ||
? ` | ||
background: ${colors.grey90.toString()}; | ||
|
||
&::before { | ||
background: ${colors.grey90.toString()}; | ||
} | ||
` | ||
: ''}; | ||
`; | ||
|
||
const StyledPlaceholder = styled.div` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lkuechler Is it possible to show the placeholder (drop area) only when an element is being dragged around? So it doesn’t react to clicks? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @marionebl takes care of that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Solved with 4f6f148 |
||
position: relative; | ||
height: 10px; | ||
height: ${getSpace(Size.S)}; | ||
width: 100%; | ||
margin-top: -5px; | ||
margin-bottom: -5px; | ||
border-radius: 3px; | ||
margin-top: -${getSpace(Size.XS)}; | ||
margin-bottom: -${getSpace(Size.XS)}; | ||
z-index: 10; | ||
|
||
&::before { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
height: 6px; | ||
width: 6px; | ||
left: 6px; | ||
top: 3px; | ||
border-radius: 3px; | ||
background: ${colors.blue40.toString()}; | ||
transform: scale(0); | ||
transition: transform 0.2s; | ||
z-index: 20; | ||
} | ||
|
||
&::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
left: 0; | ||
top: 0; | ||
background: ${colors.grey90.toString()}; | ||
height: 2px; | ||
width: calc(100% - 6px); | ||
left: ${getSpace(Size.XS)}; | ||
top: 5px; | ||
background: ${colors.blue40.toString()}; | ||
transform: scaleY(0); | ||
transition: transform 0.2s; | ||
z-index: 50; | ||
z-index: 20; | ||
} | ||
|
||
${(props: StyledPlaceholder) => | ||
props.highlightPlaceholder | ||
? ` | ||
&:after { | ||
&::before { | ||
transform: scale(1); | ||
} | ||
|
||
&::after { | ||
transform: scaleY(1); | ||
} | ||
` | ||
|
@@ -122,15 +169,15 @@ const StyledElementChild = styled.div` | |
|
||
const StyledIcon = styled(Icon)` | ||
position: absolute; | ||
left: 0; | ||
left: ${getSpace(Size.XS) + getSpace(Size.XXS)}px; | ||
fill: ${colors.grey60.toString()}; | ||
width: 12px; | ||
height: 12px; | ||
width: ${getSpace(Size.S)}px; | ||
height: ${getSpace(Size.S)}px; | ||
padding: ${getSpace(Size.XS)}px; | ||
transition: transform 0.2s; | ||
|
||
${(props: StyledIconProps) => (props.open ? 'transform: rotate(90deg)' : '')}; | ||
${(props: StyledIconProps) => (props.active ? 'fill: white' : '')}; | ||
${(props: StyledIconProps) => (props.active ? 'fill: #0070D6' : '')}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be deduced from styleguide colors |
||
`; | ||
|
||
const Element: React.StatelessComponent<ElementProps> = props => { | ||
|
@@ -155,7 +202,7 @@ const Element: React.StatelessComponent<ElementProps> = props => { | |
} = props; | ||
|
||
return ( | ||
<StyledElement title={title}> | ||
<StyledElement> | ||
<StyledPlaceholder | ||
highlightPlaceholder={highlightPlaceholder} | ||
onDragOver={(e: React.DragEvent<HTMLElement>) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lkuechler Is it possible to apply styling on the element during dragging around? So like only showing the element title text instead of a screenshot of the whole element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved with 71c298d