-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #724 from open-sausages/pulls/4/ticken-the-insert-…
…here-line Make the HoverBar more visible
- Loading branch information
Showing
7 changed files
with
207 additions
and
184 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,65 +1,83 @@ | ||
.element-editor__add-block-area-container { | ||
height: 0; | ||
display: flex; | ||
width: 100%; | ||
position: relative; | ||
align-items: center; | ||
} | ||
|
||
.element-editor__add-block-area { | ||
background-color: transparent; | ||
min-height: $spacer * 1.5; | ||
width: 100%; | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
outline: 0; | ||
transition: 0s; | ||
} | ||
$transition: all ease .2s; | ||
|
||
.element-editor__add-block-hover-bar { | ||
align-self: center; | ||
width: 100%; | ||
-webkit-appearance: button; | ||
border: 0; | ||
position: absolute; | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 0; | ||
top: 50%; | ||
transform: translateY(-66%); | ||
.element-editor { | ||
|
||
&:before { | ||
font-size: 1.5rem; | ||
background-image: radial-gradient(#fff 50%, transparent 50%); | ||
// Fallback for IE11 & other browsers that don't support the calc() below | ||
transform: translateY(-35%); | ||
// position plus 'button' to be able to modify it's z-index | ||
&__hover-bar { | ||
height: 0; | ||
display: flex; | ||
width: 100%; | ||
position: relative; | ||
z-index: 2; | ||
margin-right: $panel-padding-x/2; | ||
display: block; | ||
height: 1em; | ||
align-items: center; | ||
} | ||
|
||
&--delay { | ||
background-color: $border-color-dark; | ||
max-height: 3px; | ||
&__hover-bar-area { | ||
background-color: transparent; | ||
min-height: $spacer * 1.5; | ||
width: 100%; | ||
margin: 0; | ||
padding: 0; | ||
border: none; | ||
outline: none; | ||
transition: $transition; | ||
position: relative; | ||
|
||
&:before { | ||
transform: translateY(calc((3px/2) + -50%)); | ||
color: $border-color-dark; | ||
&:hover, &:focus, &--focus { | ||
outline: none; | ||
|
||
.element-editor__hover-bar-area-inner { | ||
margin: 0 20px; | ||
} | ||
|
||
.element-editor__hover-bar-line { | ||
opacity: 1; | ||
border-radius: 5px; | ||
max-height: 5px; | ||
&:before { | ||
transform: translateY(calc(3px + -50%)) scale(1); | ||
} | ||
} | ||
} | ||
} | ||
|
||
&--inst { | ||
background-color: $component-active-bg; | ||
max-height: 5px; | ||
&__hover-bar-area-inner { | ||
margin: 0 0; | ||
display: block; | ||
position: relative; | ||
transition: $transition; | ||
} | ||
|
||
&__hover-bar-line { | ||
background-color: $blue; | ||
transition: $transition; | ||
opacity: 0; | ||
align-self: center; | ||
width: 100%; | ||
border: 0; | ||
position: absolute; | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 0; | ||
top: 50%; | ||
transform: translateY(-66%); | ||
max-height: 0; | ||
border-radius: 0; | ||
|
||
&:before { | ||
transform: translateY(calc((5px/2) + -50%)); | ||
color: $component-active-bg; | ||
font-size: 1.5rem; | ||
background-image: radial-gradient(#fff 50%, transparent 50%); | ||
// position plus 'button' to be able to modify it's z-index | ||
position: relative; | ||
z-index: 2; | ||
margin-right: 50%; | ||
right: -.5em; | ||
display: block; | ||
height: 1em; | ||
// IE-11 fallback | ||
transform: translateY(-35%); | ||
transform: translateY(calc(-1px + -50%)) scale(0); | ||
transition: $transition; | ||
color: $blue; | ||
} | ||
} | ||
} | ||
|
||
} |
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,33 @@ | ||
import classNames from 'classnames'; | ||
|
||
/** | ||
* Utility method wrap around classeNames to prefix the return class names | ||
* @param {string} cssPrefix | ||
* @returns {Function} | ||
*/ | ||
const prefixClassNames = (cssPrefix) => (...args) => { | ||
const prefix = (str) => `${cssPrefix}${str}`; | ||
|
||
const prefixArgs = args.map(arg => { | ||
if (!arg && arg !== '') { | ||
return false; | ||
} | ||
|
||
if (typeof arg === 'object') { | ||
return Array.isArray(arg) ? | ||
arg.map(prefix) : | ||
Object.entries(arg).reduce( | ||
(accumulator, [key, value]) => ( | ||
Object.assign({}, accumulator, { [prefix(key)]: value }) | ||
), | ||
{} | ||
); | ||
} | ||
|
||
return prefix(arg); | ||
}); | ||
|
||
return classNames(...prefixArgs); | ||
}; | ||
|
||
export default prefixClassNames; |
Oops, something went wrong.