figuren-theater / label-printing

Create printable labels with blocks
GNU General Public License v3.0
2 stars 1 forks source link

Maybe use aspect-ratio in favor of min- and max- and normal-width-vodoo. #17

Open carstingaxion opened 1 year ago

carstingaxion commented 1 year ago
.wp-block-figuren-theater-label-printing {

    .components-flex-item.block-editor-block-list__layout {
        [...]

        aspect-ratio: var(--label-printing-width, var(--label-printing-doc-width, 297 )) / var(--label-printing-height, var(--label-printing-doc-height, 210 ));

    }

    .wp-block-group.alignwide[class*="is-style-label-overview-"] {

        aspect-ratio: var(--label-printing-doc-width, 297 ) / var(--label-printing-doc-height, 210 );

        .is-layout-flex {
            [...]

            > div {
                [...]
                aspect-ratio: var(--label-printing-width, var(--label-printing-doc-width, 297 )) / var(--label-printing-height, var(--label-printing-doc-height, 210 ));
            }
        }
    }
}

https://github.com/figuren-theater/label-printing/blob/b6b2e855346b4f84ac7622cd81dde505a954878c/src/block-editor/blocks/label-printing/editor.scss#L4