-
Notifications
You must be signed in to change notification settings - Fork 221
feat: update styling of layout and element pane #393
Changes from 2 commits
ca2c1d9
b0cc943
551ec59
71d38c9
744f262
76ac1ae
71c298d
42284b6
c6c52ff
4f6f148
686f264
643d538
8904d0a
5500cbf
4fe6cbf
9c223fc
57208e6
dbe48a1
c7de980
dd1a6c4
f6212c4
4b084dd
9f9f31d
3b79de9
40a6397
05dd8a2
ed39ced
70d4708
d8f8408
0a20c6e
c42f0e2
a192919
344f2cb
a3b2dc8
0da7a7c
e5ea5f0
81a7e2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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` | ||
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 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 commentThe reason will be displayed to describe this comment to others. Learn more. Solved with 71c298d |
||
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>) => { | ||
|
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.
We should not drop on subpixels - this might produce undesirable output on devices with lower pixel density.
This should be guarded with a media query, like this: