Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
16297dc630 | |||
7c3d131b46 | |||
2032df467e | |||
21bcd390d6 | |||
5f4ff8f6a2 | |||
9782077fb9 |
@ -4,9 +4,9 @@
|
|||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "designestate",
|
"gitscope": "designestate",
|
||||||
"gitrepo": "dees-csstools",
|
"gitrepo": "dees-domtools",
|
||||||
"shortDescription": "tools to simplify complex css structures",
|
"shortDescription": "tools to simplify complex css structures",
|
||||||
"npmPackagename": "@designestate/dees-csstools",
|
"npmPackagename": "@designestate/dees-domtools",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "design.estate"
|
"projectDomain": "design.estate"
|
||||||
}
|
}
|
||||||
|
20
package-lock.json
generated
20
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-csstools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -264,8 +264,7 @@
|
|||||||
"@pushrocks/smartpromise": {
|
"@pushrocks/smartpromise": {
|
||||||
"version": "3.0.6",
|
"version": "3.0.6",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.0.6.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-3.0.6.tgz",
|
||||||
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg==",
|
"integrity": "sha512-vlQlBGNVIjfClgnsfgQBU6GIKcskYSFzEcKLt18ngPzPEcjKklXcxaqzLXpnoxR+KBh30QPE8255ncYHXuPPOg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"@pushrocks/smartrequest": {
|
"@pushrocks/smartrequest": {
|
||||||
"version": "1.1.47",
|
"version": "1.1.47",
|
||||||
@ -953,6 +952,19 @@
|
|||||||
"graceful-fs": "^4.1.6"
|
"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": {
|
"locate-path": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-5.0.0.tgz",
|
"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",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "tools to simplify complex css structures",
|
"description": "tools to simplify complex css structures",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -8,8 +8,8 @@
|
|||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild)",
|
"build": "(tsbuild --web)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -20,7 +20,10 @@
|
|||||||
"tslint": "^5.11.0",
|
"tslint": "^5.11.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
|
"lit-element": "^2.3.1"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
"ts_web/**/*",
|
"ts_web/**/*",
|
||||||
|
18
readme.md
18
readme.md
@ -1,17 +1,17 @@
|
|||||||
# @designestate/dees-csstools
|
# @designestate/dees-domtools
|
||||||
tools to simplify complex css structures
|
tools to simplify complex css structures
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@designestate/dees-csstools)
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@designestate/dees-domtools)
|
||||||
* [gitlab.com (source)](https://gitlab.com/designestate/dees-csstools)
|
* [gitlab.com (source)](https://gitlab.com/designestate/dees-domtools)
|
||||||
* [github.com (source mirror)](https://github.com/designestate/dees-csstools)
|
* [github.com (source mirror)](https://github.com/designestate/dees-domtools)
|
||||||
* [docs (typedoc)](https://designestate.gitlab.io/dees-csstools/)
|
* [docs (typedoc)](https://designestate.gitlab.io/dees-domtools/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/designestate/dees-csstools/commits/master)
|
[](https://gitlab.com/designestate/dees-domtools/commits/master)
|
||||||
[](https://gitlab.com/designestate/dees-csstools/commits/master)
|
[](https://gitlab.com/designestate/dees-domtools/commits/master)
|
||||||
[](https://www.npmjs.com/package/@designestate/dees-csstools)
|
[](https://www.npmjs.com/package/@designestate/dees-domtools)
|
||||||
[](https://snyk.io/test/npm/@designestate/dees-csstools)
|
[](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://nodejs.org/dist/latest-v10.x/docs/api/)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://prettier.io/)
|
[](https://prettier.io/)
|
||||||
|
@ -2,7 +2,7 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
|||||||
import * as deesCsstools from '../ts/index';
|
import * as deesCsstools from '../ts/index';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
console.log(deesCsstools.standardExport);
|
console.log('hi');
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
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}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
};
|
25
ts/csstools.elementbasicsetup.ts
Normal file
25
ts/csstools.elementbasicsetup.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
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();
|
||||||
|
const documentReady = defer();
|
||||||
|
document.onreadystatechange = () => {
|
||||||
|
if (document.readyState === 'interactive') {
|
||||||
|
documentReady.resolve();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await documentReady.promise;
|
||||||
|
const head = document.querySelector('head');
|
||||||
|
const styleElement = document.createElement('style');
|
||||||
|
styleElement.type = 'text/css';
|
||||||
|
styleElement.appendChild(document.createTextNode(materialFontCss));
|
||||||
|
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