Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
4db0e6f5fc | |||
40b8c5010d | |||
16297dc630 | |||
7c3d131b46 | |||
2032df467e | |||
21bcd390d6 | |||
5f4ff8f6a2 | |||
9782077fb9 |
@ -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"
|
||||
}
|
||||
|
20
package-lock.json
generated
20
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-csstools",
|
||||
"version": "1.0.2",
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -264,8 +264,7 @@
|
||||
"@pushrocks/smartpromise": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.0.6.tgz",
|
||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg=="
|
||||
},
|
||||
"@pushrocks/smartrequest": {
|
||||
"version": "1.1.47",
|
||||
@ -953,6 +952,19 @@
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"lit-element": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lit-element/-/lit-element-2.3.1.tgz",
|
||||
"integrity": "sha512-tOcUAmeO3BzwiQ7FGWdsshNvC0HVHcTFYw/TLIImmKwXYoV0E7zCBASa8IJ7DiP4cen/Yoj454gS0qqTnIGsFA==",
|
||||
"requires": {
|
||||
"lit-html": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"lit-html": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lit-html/-/lit-html-1.2.1.tgz",
|
||||
"integrity": "sha512-GSJHHXMGLZDzTRq59IUfL9FCdAlGfqNp/dEa7k7aBaaWD+JKaCjsAk9KYm2V12ItonVaYx2dprN66Zdm1AuBTQ=="
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-5.0.0.tgz",
|
||||
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-csstools",
|
||||
"version": "1.0.2",
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "1.0.6",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -8,8 +8,8 @@
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)",
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)",
|
||||
"format": "(gitzone format)"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -20,7 +20,10 @@
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"lit-element": "^2.3.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
|
18
readme.md
18
readme.md
@ -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
|
||||
[](https://gitlab.com/designestate/dees-csstools/commits/master)
|
||||
[](https://gitlab.com/designestate/dees-csstools/commits/master)
|
||||
[](https://www.npmjs.com/package/@designestate/dees-csstools)
|
||||
[](https://snyk.io/test/npm/@designestate/dees-csstools)
|
||||
[](https://gitlab.com/designestate/dees-domtools/commits/master)
|
||||
[](https://gitlab.com/designestate/dees-domtools/commits/master)
|
||||
[](https://www.npmjs.com/package/@designestate/dees-domtools)
|
||||
[](https://snyk.io/test/npm/@designestate/dees-domtools)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
@ -2,7 +2,7 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as deesCsstools from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(deesCsstools.standardExport);
|
||||
console.log('hi');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
60
ts/csstools.breakpoints.ts
Normal file
60
ts/csstools.breakpoints.ts
Normal file
@ -0,0 +1,60 @@
|
||||
export const desktop = 1240;
|
||||
export const tablet = 700;
|
||||
export const phablet = 500;
|
||||
export const phone = 340;
|
||||
|
||||
export type TEnvironment = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||
|
||||
let environment: TEnvironment = 'native';
|
||||
|
||||
export const setEnvironment = envArg => {
|
||||
environment = envArg;
|
||||
};
|
||||
|
||||
export const cssForTablet = (contentArg) => {
|
||||
if (environment === 'native' || environment === 'desktop') {
|
||||
return `
|
||||
@media (max-width: ${tablet}px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
} else if (environment === 'tablet' || environment === 'phablet' || environment === 'phone') {
|
||||
return `
|
||||
@media (min-width: 0px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
}
|
||||
};
|
||||
|
||||
export const cssForPhablet = (contentArg) => {
|
||||
if (environment === 'native' || environment === 'desktop') {
|
||||
return `
|
||||
@media (max-width: ${phablet}px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
} else if (environment === 'phablet' || environment === 'phone') {
|
||||
return `
|
||||
@media (min-width: 0px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
}
|
||||
};
|
||||
|
||||
export const cssForPhone = (contentArg) => {
|
||||
if (environment === 'native' || environment === 'desktop') {
|
||||
return `
|
||||
@media (max-width: ${phone}px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
} else if (environment === 'phone') {
|
||||
return `
|
||||
@media (min-width: 0px) {
|
||||
${contentArg}
|
||||
}
|
||||
`;
|
||||
}
|
||||
};
|
44
ts/csstools.elementbasicsetup.ts
Normal file
44
ts/csstools.elementbasicsetup.ts
Normal file
@ -0,0 +1,44 @@
|
||||
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 {
|
||||
// lets prevent double execution
|
||||
globalThis.deesCssToolsReady = defer();
|
||||
|
||||
// lets make sure the dom is ready
|
||||
const documentReady = defer();
|
||||
document.onreadystatechange = () => {
|
||||
if (document.readyState === 'interactive') {
|
||||
documentReady.resolve();
|
||||
}
|
||||
};
|
||||
await documentReady.promise;
|
||||
|
||||
// lets get started
|
||||
const head = document.querySelector('head');
|
||||
const body = document.querySelector('body');
|
||||
|
||||
// material font
|
||||
const materialFontCss = `
|
||||
@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');
|
||||
}
|
||||
`;
|
||||
const styleElement = document.createElement('style');
|
||||
styleElement.type = 'text/css';
|
||||
styleElement.appendChild(document.createTextNode(materialFontCss));
|
||||
head.appendChild(styleElement);
|
||||
|
||||
|
||||
globalThis.deesCssToolsReady.resolve();
|
||||
}
|
||||
};
|
9
ts/csstools.elementbasicstyles.ts
Normal file
9
ts/csstools.elementbasicstyles.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { html } from 'lit-element';
|
||||
export const elementBasicStyles = html`
|
||||
<style>
|
||||
* {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
`;
|
@ -1,2 +0,0 @@
|
||||
const removeme = {};
|
||||
export { removeme };
|
@ -1,3 +1,8 @@
|
||||
import * as plugins from './dees-csstools.plugins';
|
||||
export * from './csstools.elementbasicsetup';
|
||||
export * from './csstools.elementbasicstyles';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
import * as breakpoints from './csstools.breakpoints';
|
||||
|
||||
export {
|
||||
breakpoints
|
||||
};
|
||||
|
Reference in New Issue
Block a user