/
spacing.js
38 lines (33 loc) · 1.41 KB
/
spacing.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @license
* Copyright (c) 2021 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import { css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
import './version.js';
const spacing = css`
:host {
/* Square */
--lumo-space-xs: 0.25rem;
--lumo-space-s: 0.5rem;
--lumo-space-m: 1rem;
--lumo-space-l: 1.5rem;
--lumo-space-xl: 2.5rem;
/* Wide */
--lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);
--lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);
--lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);
--lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);
--lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);
/* Tall */
--lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);
--lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);
--lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);
--lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);
--lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);
}
`;
const $tpl = document.createElement('template');
$tpl.innerHTML = `<style>${spacing.toString().replace(':host', 'html')}</style>`;
document.head.appendChild($tpl.content);
export { spacing };