Compare commits

...

15 Commits

Author SHA1 Message Date
bef4ea7bed 1.0.12 2020-05-24 18:54:10 +00:00
17a8151b2f fix(core): update 2020-05-24 18:54:10 +00:00
5aee15a23b 1.0.11 2020-05-23 17:18:15 +00:00
38d78b4e12 1.0.10 2020-05-23 17:13:10 +00:00
ec36a516c0 fix(core): update 2020-05-23 17:13:09 +00:00
1c844d35ca 1.0.9 2020-05-23 16:55:37 +00:00
ecb387f59e fix(core): update 2020-05-23 16:55:36 +00:00
9b3c92fef5 1.0.8 2020-05-23 16:43:37 +00:00
74cf94a69e fix(core): update 2020-05-23 16:43:36 +00:00
9f76d4e920 1.0.7 2020-05-23 16:36:30 +00:00
082ef21078 fix(core): update 2020-05-23 16:36:29 +00:00
4db0e6f5fc 1.0.6 2020-05-23 15:44:58 +00:00
40b8c5010d fix(core): update 2020-05-23 15:44:58 +00:00
16297dc630 1.0.5 2020-05-23 15:40:09 +00:00
7c3d131b46 fix(core): update 2020-05-23 15:40:08 +00:00
12 changed files with 108 additions and 32 deletions

View File

@ -4,9 +4,9 @@
"module": {
"githost": "gitlab.com",
"gitscope": "designestate",
"gitrepo": "dees-csstools",
"gitrepo": "dees-domtools",
"shortDescription": "tools to simplify complex css structures",
"npmPackagename": "@designestate/dees-csstools",
"npmPackagename": "@designestate/dees-domtools",
"license": "MIT",
"projectDomain": "design.estate"
}

4
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@designestate/dees-csstools",
"version": "1.0.4",
"name": "@designestate/dees-domtools",
"version": "1.0.12",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@designestate/dees-csstools",
"version": "1.0.4",
"name": "@designestate/dees-domtools",
"version": "1.0.12",
"private": false,
"description": "tools to simplify complex css structures",
"main": "dist_ts/index.js",

View File

@ -1,17 +1,17 @@
# @designestate/dees-csstools
# @designestate/dees-domtools
tools to simplify complex css structures
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@designestate/dees-csstools)
* [gitlab.com (source)](https://gitlab.com/designestate/dees-csstools)
* [github.com (source mirror)](https://github.com/designestate/dees-csstools)
* [docs (typedoc)](https://designestate.gitlab.io/dees-csstools/)
* [npmjs.org (npm package)](https://www.npmjs.com/package/@designestate/dees-domtools)
* [gitlab.com (source)](https://gitlab.com/designestate/dees-domtools)
* [github.com (source mirror)](https://github.com/designestate/dees-domtools)
* [docs (typedoc)](https://designestate.gitlab.io/dees-domtools/)
## Status for master
[![pipeline status](https://gitlab.com/designestate/dees-csstools/badges/master/pipeline.svg)](https://gitlab.com/designestate/dees-csstools/commits/master)
[![coverage report](https://gitlab.com/designestate/dees-csstools/badges/master/coverage.svg)](https://gitlab.com/designestate/dees-csstools/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@designestate/dees-csstools.svg)](https://www.npmjs.com/package/@designestate/dees-csstools)
[![Known Vulnerabilities](https://snyk.io/test/npm/@designestate/dees-csstools/badge.svg)](https://snyk.io/test/npm/@designestate/dees-csstools)
[![pipeline status](https://gitlab.com/designestate/dees-domtools/badges/master/pipeline.svg)](https://gitlab.com/designestate/dees-domtools/commits/master)
[![coverage report](https://gitlab.com/designestate/dees-domtools/badges/master/coverage.svg)](https://gitlab.com/designestate/dees-domtools/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@designestate/dees-domtools.svg)](https://www.npmjs.com/package/@designestate/dees-domtools)
[![Known Vulnerabilities](https://snyk.io/test/npm/@designestate/dees-domtools/badge.svg)](https://snyk.io/test/npm/@designestate/dees-domtools)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)

View File

@ -1,14 +0,0 @@
import { defer } from '@pushrocks/smartpromise';
/**
* a basic setup for elements
* makes sure everything is in check
*/
export const elementBasicSetup = async () => {
if (globalThis.deesCssToolsReady) {
await globalThis.deesCssToolsReady.promise;
} else {
globalThis.deesCssToolsReady = defer();
globalThis.deesCssToolsReady.resolve();
}
};

View File

@ -0,0 +1,5 @@
export class DeesDomTools {
public static createDomTools = () => {
globalThis.deesDomTools = new DeesDomTools();
}
}

6
ts/domtools.colors.ts Normal file
View File

@ -0,0 +1,6 @@
export interface IDeesColorSet {
primaryAccent: string;
secondaryAccent: string;
primaryBackground: string;
secondaryBackground: string;
}

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

@ -0,0 +1,69 @@
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
* makes sure everything is in check
*/
export const elementBasicSetup = async () => {
if (globalThis.deesCssToolsReady) {
await globalThis.deesCssToolsReady.promise;
} else {
// lets prevent double execution
globalThis.deesCssToolsReady = defer();
// lets make sure the dom is ready
const documentReady = defer();
const readyStateChangedFunc = () => {
if (document.readyState === 'interactive' || document.readyState === 'complete') {
console.log('elementBasicSetup: element basic setup complete')
documentReady.resolve();
} else {
console.log('elementBasicSetup: document not yet ready');
}
};
document.addEventListener('readystatechange', readyStateChangedFunc);
console.log('elementBasicSetup: waiting for document to be ready');
await documentReady.promise;
console.log('elementBasicSetup: document ready!');
// lets get started
const head = document.querySelector('head');
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
const materialFontStyles = `
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
}
`;
createStyleElement(head, materialFontStyles);
// Roboto Font
const robotoFontCss = `
@import url('https://fonts.googleapis.com/css?family=Roboto');
`;
createStyleElement(head, robotoFontCss);
globalThis.deesCssToolsReady.resolve();
}
};

View File

@ -1,8 +1,11 @@
export * from './csstools.elementbasicsetup';
export * from './csstools.elementbasicstyles';
export * from './domtools.colors';
export * from './domtools.elementbasicsetup';
export * from './domtools.elementbasicstyles';
import * as breakpoints from './csstools.breakpoints';
import * as breakpoints from './domtools.breakpoints';
import * as css from './domtools.css';
export {
css,
breakpoints
};