Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder color as a variable #2662

Merged
merged 4 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/css/grapes.min.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/styles/scss/_gjs_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ $fontName: 'main-fonts' !default;
$fontSize: 0.7rem !default;
$fontSizeS: 0.75rem !default;
$fontV: 20 !default;//random(1000)

/* Tools */
$placeholderColor: $colorGreen !default;
19 changes: 17 additions & 2 deletions src/styles/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,32 @@ $colorsAll: (one, $primaryColor),
.#{$app-prefix}placeholder,
.#{$nv-prefix}placeholder {
border-style: solid !important;
border-color: $colorGreen;
outline: none;
box-sizing: border-box;
transition: top $animSpeed, left $animSpeed,
width $animSpeed, height $animSpeed;
}

.#{$app-prefix}placeholder.horizontal,
.#{$com-prefix}placeholder.horizontal,
.#{$nv-prefix}placeholder.horizontal {
border-color: transparent $placeholderColor;
border-width: 3px 5px;
margin: -3px 0 0;
}

.#{$app-prefix}placeholder.vertical,
.#{$com-prefix}placeholder.vertical,
.#{$nv-prefix}placeholder.vertical {
border-color: $placeholderColor transparent;
border-width: 5px 3px;
margin: 0 0 0 -3px;
}

.#{$app-prefix}placeholder-int,
.#{$com-prefix}placeholder-int,
.#{$nv-prefix}placeholder-int {
background-color: $colorGreen;
background-color: $placeholderColor;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
height: 100%; width: 100%;
pointer-events: none;
Expand Down
16 changes: 8 additions & 8 deletions src/utils/Sorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,23 +966,23 @@ export default Backbone.View.extend({
h = 0,
un = 'px',
margI = 5,
brdCol = '#62c462',
brd = 3,
method = pos.method;
var elDim = dims[pos.index];
plh.style.borderColor = 'transparent ' + brdCol;
plh.style.borderWidth = brd + un + ' ' + (brd + 2) + un;
plh.style.margin = '-' + brd + 'px 0 0';

// Placeholder orientation
plh.classList.remove('vertical');
plh.classList.add('horizontal');

if (elDim) {
// If it's not in flow (like 'float' element)
if (!elDim[4]) {
w = 'auto';
h = elDim[2] - marg * 2 + un;
t = elDim[0] + marg;
l = method == 'before' ? elDim[1] - marg : elDim[1] + elDim[3] - marg;
plh.style.borderColor = brdCol + ' transparent';
plh.style.borderWidth = brd + 2 + un + ' ' + brd + un;
plh.style.margin = '0 0 0 -' + brd + 'px';

plh.classList.remove('horizontal');
plh.classList.add('vertical');
} else {
w = elDim[3] + un;
h = 'auto';
Expand Down