correction page margins
This commit is contained in:
parent
3ae2d0e310
commit
59f6716121
3 changed files with 32 additions and 50 deletions
|
|
@ -11,20 +11,19 @@
|
|||
align-items: center;
|
||||
gap: var(--space-xs);
|
||||
margin-bottom: var(--space-s);
|
||||
// border: 1px solid var(--color-300);
|
||||
// border-radius: var(--border-radius);
|
||||
// padding: 2px 1ch;
|
||||
|
||||
|
||||
.icon {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
|
||||
svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: var(--color-600);
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 1.2rem;
|
||||
color: var(--color-600);
|
||||
|
|
@ -48,14 +47,17 @@
|
|||
.setting__section[data-setting="dimensions"] {
|
||||
border-top: none;
|
||||
padding-top: 0;
|
||||
|
||||
.setting__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.setting__body {
|
||||
grid-column: 2;
|
||||
width: 0;
|
||||
display: flex;
|
||||
gap: var(--space-s);
|
||||
|
||||
.field-size-page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -65,7 +67,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
.field-size-page:first-of-type .unit-toggle{ display: none; }
|
||||
.field-size-page:first-of-type .unit-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -290,14 +290,7 @@ watch([customWidth, customHeight], () => {
|
|||
|
||||
const updateMargins = () => {
|
||||
const marginValue = `${margins.value.top.value}${margins.value.top.unit} ${margins.value.right.value}${margins.value.right.unit} ${margins.value.bottom.value}${margins.value.bottom.unit} ${margins.value.left.value}${margins.value.left.unit}`;
|
||||
|
||||
const currentBlock = stylesheetStore.extractBlock('@page');
|
||||
const updatedBlock = currentBlock.replace(
|
||||
/(margin:\s*)[^;]+/,
|
||||
`$1${marginValue}`
|
||||
);
|
||||
|
||||
stylesheetStore.replaceBlock(currentBlock, updatedBlock);
|
||||
stylesheetStore.updateProperty('@page', 'margin', marginValue, '');
|
||||
};
|
||||
|
||||
// Watch margin values (number inputs) with debounce
|
||||
|
|
@ -330,22 +323,7 @@ watch(
|
|||
|
||||
const updateBackground = () => {
|
||||
if (!background.value.value) return;
|
||||
|
||||
const currentBlock = stylesheetStore.extractBlock('@page');
|
||||
|
||||
if (currentBlock.includes('background:')) {
|
||||
const updatedBlock = currentBlock.replace(
|
||||
/(background:\s*)[^;]+/,
|
||||
`$1${background.value.value}`
|
||||
);
|
||||
stylesheetStore.replaceBlock(currentBlock, updatedBlock);
|
||||
} else {
|
||||
const updatedBlock = currentBlock.replace(
|
||||
/(\s*})$/,
|
||||
` background: ${background.value.value};\n$1`
|
||||
);
|
||||
stylesheetStore.replaceBlock(currentBlock, updatedBlock);
|
||||
}
|
||||
stylesheetStore.updateProperty('@page', 'background', background.value.value, '');
|
||||
};
|
||||
|
||||
// Watch background value (text input) with debounce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue