fix(core): update

This commit is contained in:
Philipp Kunz 2020-05-23 17:13:09 +00:00
parent 1c844d35ca
commit ec36a516c0
3 changed files with 33 additions and 5 deletions

7
ts/domtools.css.ts Normal file
View File

@ -0,0 +1,7 @@
export const cssGridColumns = (amountOfColumnsArg: number, gapSizeArg: number) => {
let returnString = ``;
for (let i = 0; i < amountOfColumnsArg; i++) {
returnString += ` calc((100%/${amountOfColumnsArg}) - (${gapSizeArg * (amountOfColumnsArg - 1)}px/${amountOfColumnsArg}))`;
}
return returnString;
};

View File

@ -1,5 +1,12 @@
import { defer } from '@pushrocks/smartpromise'; import { defer } from '@pushrocks/smartpromise';
const createStyleElement = (headElement: HTMLElement, styleText: string) => {
const styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.appendChild(document.createTextNode(styleText));
headElement.appendChild(styleElement);
};
/** /**
* a basic setup for elements * a basic setup for elements
* makes sure everything is in check * makes sure everything is in check
@ -30,8 +37,18 @@ export const elementBasicSetup = async () => {
const head = document.querySelector('head'); const head = document.querySelector('head');
const body = document.querySelector('body'); const body = document.querySelector('body');
// bodyStyles
const bodyStyles = `
body {
margin: 0px;
font-family: 'Roboto', sans-serif;
box-sizing: border-box;
}
`;
createStyleElement(head, bodyStyles);
// material font // material font
const materialFontCss = ` const materialFontStyles = `
@font-face { @font-face {
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
@ -39,11 +56,13 @@ export const elementBasicSetup = async () => {
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2'); src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
} }
`; `;
const styleElement = document.createElement('style'); createStyleElement(head, materialFontStyles);
styleElement.type = 'text/css';
styleElement.appendChild(document.createTextNode(materialFontCss));
head.appendChild(styleElement);
// Roboto Font
const robotoFontCss = `
@import url('https://fonts.googleapis.com/css?family=Roboto');
`;
createStyleElement(head, robotoFontCss);
globalThis.deesCssToolsReady.resolve(); globalThis.deesCssToolsReady.resolve();
} }

View File

@ -2,7 +2,9 @@ export * from './domtools.elementbasicsetup';
export * from './domtools.elementbasicstyles'; export * from './domtools.elementbasicstyles';
import * as breakpoints from './domtools.breakpoints'; import * as breakpoints from './domtools.breakpoints';
import * as css from './domtools.css';
export { export {
css,
breakpoints breakpoints
}; };