-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assembler: Allow to zoom out the preview (#83034)
* Device Switcher: Add range control of zoom * Device Switcher: Handle zoom-out * Device Switcher: Adjust styles * Adjust the zoom-out behavior * Adjust slider styles * Adjust styles * Disable zoom-out behavior when there is no selected pattern * Clean up: PatternLayout * Keep the action bar un-scaled and stick to the top of the active pattern * Centralize viewport components * Adjust action bar position * Fix types * Fix viewport height * Add tracks event * Debounce the tracks event
- Loading branch information
1 parent
fd9c9f4
commit 430e0b0
Showing
12 changed files
with
358 additions
and
376 deletions.
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
112 changes: 74 additions & 38 deletions
112
...per/declarative-flow/internals/steps-repository/pattern-assembler/pattern-action-bar.scss
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 |
---|---|---|
@@ -1,54 +1,90 @@ | ||
.pattern-assembler { | ||
.pattern-action-bar { | ||
.pattern-assembler__pattern-action-bar { | ||
display: flex; | ||
align-items: center; | ||
gap: 0; | ||
position: absolute; | ||
top: 16px; | ||
left: 16px; | ||
height: 40px; | ||
padding: 0; | ||
border: 1px solid #1e1e1e; | ||
border-radius: 2px; | ||
box-sizing: border-box; | ||
background-color: #fff; | ||
z-index: 1; | ||
|
||
&.pattern-assembler__pattern-action-bar--overflow { | ||
transform: translate(-16px, calc(-100% - 16px - 12px)); | ||
|
||
&::before { | ||
display: block; | ||
} | ||
} | ||
|
||
.pattern-action-bar__block { | ||
flex-direction: column; | ||
display: flex; | ||
opacity: 0; | ||
align-items: center; | ||
position: absolute; | ||
justify-content: center; | ||
} | ||
|
||
.pattern-action-bar__action { | ||
height: 40px; | ||
right: 0; | ||
|
||
.pattern-action-bar__block { | ||
flex-direction: column; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
&.has-icon { | ||
min-width: 40px; | ||
max-width: 40px; | ||
padding: 0; | ||
} | ||
|
||
.pattern-action-bar__action { | ||
&.has-icon { | ||
min-width: 40px; | ||
max-width: 40px; | ||
padding: 0; | ||
} | ||
svg { | ||
fill: var(--studio-gray-80); | ||
} | ||
|
||
&:not(:disabled):hover { | ||
color: var(--studio-blue-50); | ||
|
||
svg { | ||
fill: var(--studio-gray-80); | ||
fill: var(--studio-blue-50); | ||
} | ||
} | ||
|
||
&:not(:disabled):hover { | ||
color: var(--studio-blue-50); | ||
&--move-up, | ||
&--move-down { | ||
height: 13px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
svg { | ||
fill: var(--studio-blue-50); | ||
} | ||
&--shuffle { | ||
&.has-icon { | ||
flex-direction: row; | ||
gap: 4px; | ||
line-height: 40px; | ||
max-width: none; | ||
padding: 0 12px; | ||
} | ||
} | ||
} | ||
|
||
&--move-up, | ||
&--move-down { | ||
height: 13px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
> .pattern-action-bar__action:not(:first-child) { | ||
border-left: 1px solid #1e1e1e; | ||
} | ||
|
||
&--shuffle { | ||
&.has-icon { | ||
flex-direction: row; | ||
gap: 4px; | ||
line-height: 40px; | ||
max-width: none; | ||
padding: 0 12px; | ||
} | ||
} | ||
} | ||
/** | ||
* Increase the area of the action bar to keep the element active | ||
* when hovering on the the action bar | ||
*/ | ||
&::before { | ||
content: ""; | ||
display: none; | ||
position: absolute; | ||
top: -12px; | ||
left: -12px; | ||
width: 100%; | ||
height: 100%; | ||
padding: 12px 12px 20px 12px; | ||
box-sizing: content-box; | ||
z-index: -1; | ||
} | ||
} |
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
Oops, something went wrong.