editor: add snap-to-grid feature, set grid's width via theming vars

This commit is contained in:
jean-emmanuel 2016-12-11 20:11:52 +01:00
parent b90e839590
commit 4f69a73d0f
6 changed files with 43 additions and 13 deletions

View file

@ -288,3 +288,18 @@
cursor:-webkit-grabbing;
}
}
// GRID
.editor-enabled {
.tab:not(.has-tabs), .panel {
background-image: linear-gradient(to bottom, var(--color-grid) 1rem, transparent 1rem),
linear-gradient(to right, var(--color-grid) 1rem, transparent 1rem);
--size: calc(var(--grid-width) * calc(var(--grid-width) - 1) / calc(var(--grid-width) - 1) * 1rem);
background-size: var(--size) var(--size);
background-attachment: local;
background-position: -1rem -1rem;
}
}

View file

@ -12,6 +12,7 @@
--color-accent:#528bff;
--color-custom:var(--color-accent);
--color-grid: transparentize(#528bff, 0.9);
@ -21,6 +22,8 @@
--pixel-scale:1;
--grid-width:10;
/* Unset variables by default
--display-input:none; // Hides widgets' numeric inputs