forked from scratchfoundation/scratch-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Design pass: layout panes, sprite libraries, info area, import button…
…s, + menu bar (scratchfoundation#83) * Covers parts of these issues: GUI layout panes (scratchfoundation#69), sprite libraries (scratchfoundation#12), import buttons (scratchfoundation#64), menu bar (scratchfoundation#67), and sprite info area (scratchfoundation#53) ~ Refactored layout pane structure by removing `display: flex` from `.box`, by default. Declaring flex instead only where specifically needed. This helped fix layout quirks, and should help us avoid hard to find issues related to nested flex boxes ~ Added descriptive classnames to boxes/containers/wrappers. Moved more padding, margins + layout into these wrappers to help with component reusability. ~ Set up a spacer unit variable inside `gui.css`, to start keeping consistent padding, margins and rounded corners between panes. Used [CSS/PostCSS Modules](https://github.com/css-modules/postcss-modules-values) to avoid SCSS dependency. ~ Refactored inline styles from JSX, into CSS files. 2 reasons: a) prepping for reuse of CSS Module variables. b) Feels easier to debug complex flex layouts when all the styles are in one place vs JS/HTML/CSS syntax mixed together ~ Added menu bar into layout via new component, and sprite info header in sprite selector pane, with stubs for the labels + forms. Sprite items are correctly scrolling, while leaving the header fixed, in Chrome. Mostly working in FFx. Not working in Safari, IE yet. ~ Style pass on library modal ~ Experimenting with a few different transition styles: Logo in menu bar, sprite library items, Add buttons.
- Loading branch information
1 parent
646c885
commit 74dde69
Showing
44 changed files
with
6,657 additions
and
153 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
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,5 +1,2 @@ | ||
.box { | ||
display: flex; | ||
position: relative; | ||
background-color: #E9EEF2; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* | ||
OQ: convention: _ for variables? | ||
TODO: refactor into resuable vars file | ||
https://github.com/css-modules/css-modules/blob/master/docs/values-variables.md | ||
*/ | ||
@value _space: 0.5rem; | ||
|
||
.page-wrapper { | ||
height: 100%; | ||
} | ||
|
||
.body-wrapper { | ||
/* | ||
Calc the height by subtracting the menu bar height | ||
TODO: Make height a reusable variable, link to use in .menu-bar | ||
*/ | ||
height: calc(100% - 3rem); | ||
background-color: #e8edf1; | ||
} | ||
|
||
.flex-wrapper { | ||
display: flex; | ||
|
||
/* | ||
Make 2 columns: | ||
a) for the blocks + workspace panes, and | ||
b) for combined stage menu + stage + sprite/stage selectors | ||
*/ | ||
flex-direction: row; | ||
height: 100%; | ||
} | ||
|
||
.blocks-wrapper { | ||
/* | ||
scratch-blocks is based on absolute positioning, which injects | ||
inside this element and becomes the child | ||
*/ | ||
position: relative; | ||
|
||
flex-basis: 600px; | ||
flex-grow: 1; | ||
flex-shrink: 0; | ||
|
||
/* | ||
Normally we'd use padding, but the absolute positioning ignores it, | ||
so use margin instead. Temporary, until tabs are inserted. | ||
*/ | ||
margin-top: 3rem; | ||
|
||
background: #e8edf1; | ||
} | ||
|
||
.stage-and-target-wrapper { | ||
/* | ||
Make rows for children: | ||
1) stage menu | ||
2) stage | ||
3) sprite/stage selectors | ||
Only reason we need this, is so .targetWrapper, which holds the selectors, | ||
goes to full vertical height of the window | ||
*/ | ||
display: flex; | ||
flex-direction: column; | ||
|
||
/* | ||
Calc the minimum width for this pane, accounting for left + right spacing. | ||
If and when the width doesn't need to be fixed, we can move the spacing out | ||
of this calc, and into padding instead | ||
*/ | ||
flex-basis: calc(480px + (_space * 2)); | ||
} | ||
|
||
.stage-wrapper { | ||
padding-left: _space; | ||
padding-right: _space; | ||
} | ||
|
||
.target-wrapper { | ||
/* Take all the available vertical space available. | ||
Works in tandem with height: 100%; which is set on the child: .targetPane | ||
TODO: Not working in Safari, not great in FFx | ||
*/ | ||
flex-grow: 1; | ||
flex-basis: 0; | ||
|
||
padding-top: _space; | ||
padding-left: _space; | ||
padding-right: _space; | ||
|
||
/* | ||
For making the sprite-selector a scrollable pane. | ||
TODO: Not working in Safari | ||
*/ | ||
overflow: hidden; | ||
} | ||
|
||
.stage-menu-wrapper { | ||
display: flex; | ||
flex-shrink: 0; | ||
align-items: center; | ||
height: 3rem; | ||
padding: _space; | ||
} |
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 |
---|---|---|
@@ -1,17 +1,53 @@ | ||
.library-item { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
flex-basis: 160px; | ||
height: 160px; | ||
padding: 1rem 1rem 0 1rem; | ||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
color: #575e75; | ||
cursor: pointer; | ||
text-align: center; | ||
width: 140px; | ||
border-radius: 0.5rem; | ||
border-color: transparent; | ||
border-width: 1px; | ||
border-style: solid; | ||
transition: all 1s ease-out; /* slower fade out */ | ||
} | ||
|
||
.library-item:hover { | ||
border-color: #e1e1e1; | ||
transition: 0.25s ease-out; | ||
background: #f0f0f0; | ||
} | ||
|
||
.library-item.is-selected { | ||
background: #aaa; | ||
border-radius: 6px; | ||
border-color: #1dacf4; | ||
background: #f0f0f0; | ||
transition: 0.25s ease-out; | ||
} | ||
|
||
.library-item-image-container { | ||
height: 140px; | ||
height: 100px; | ||
} | ||
|
||
.library-item-image { | ||
align-self: center; | ||
max-width: 100%; | ||
max-height: 100%; | ||
} | ||
|
||
.library-item-name { | ||
width: 80%; | ||
margin: 0.25rem 0; | ||
text-align: center; | ||
|
||
/* | ||
For truncating overflowing text gracefully | ||
Min-width is for a bug: https://css-tricks.com/flexbox-truncated-text | ||
*/ | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
min-width: 0; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
.library-scroll-grid { | ||
overflow-y: auto; | ||
display: flex; | ||
overflow-y: scroll; | ||
height: 100%; | ||
} | ||
|
||
.modal-header { | ||
width: 100%; | ||
margin-bottom: 3rem; | ||
padding: 0.5rem; | ||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
font-size: 1.5rem; | ||
font-weight: normal; | ||
color: #8e8f95; | ||
border-bottom: 1px solid lightgray; | ||
} |
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.