diff --git a/changelog.md b/changelog.md index fcaa76001..b54fbafd7 100755 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ -## Next / 2018-09-16 +## Next / 2018-12-18 +- [jss-starter-kit] Introduced `jss-starter-kit.bundle.js`, which packages all the other libraries into one import for playgrounds like Codepen. ([#936](https://github.com/cssinjs/jss/pull/936)) - [jss] Fix multiple cases where linking CSS rules didn't work ([#815](https://github.com/cssinjs/jss/pull/815), [#710](https://github.com/cssinjs/jss/pull/710), [#664](https://github.com/cssinjs/jss/pull/664)) - [jss] Added support for Typed CSSOM values ([#882](https://github.com/cssinjs/jss/pull/882)) - [jss] Added scoped keyframes support ([#346](https://github.com/cssinjs/jss/pull/346)) diff --git a/docs/setup.md b/docs/setup.md index ed4bbebff..cd13be716 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -10,6 +10,9 @@ yarn add jss For bower or direct script injection use [unpkg](https://unpkg.com): +Unminified, bundled ESM: +https://unpkg.com/jss-starter-kit/dist/jss-starter-kit.bundle.js + Unminified UMD: https://unpkg.com/jss/dist/jss.js diff --git a/packages/jss-starter-kit/.size-snapshot.json b/packages/jss-starter-kit/.size-snapshot.json new file mode 100644 index 000000000..08ed80687 --- /dev/null +++ b/packages/jss-starter-kit/.size-snapshot.json @@ -0,0 +1,31 @@ +{ + "dist/jss-starter-kit.js": { + "bundled": 82381, + "minified": 33203, + "gzipped": 9557 + }, + "dist/jss-starter-kit.min.js": { + "bundled": 81265, + "minified": 32683, + "gzipped": 9306 + }, + "dist/jss-starter-kit.cjs.js": { + "bundled": 2480, + "minified": 2273, + "gzipped": 682 + }, + "dist/jss-starter-kit.esm.js": { + "bundled": 1408, + "minified": 1302, + "gzipped": 452, + "treeshaked": { + "rollup": { + "code": 836, + "import_statements": 541 + }, + "webpack": { + "code": 2342 + } + } + } +} diff --git a/packages/jss-starter-kit/LICENSE b/packages/jss-starter-kit/LICENSE new file mode 100644 index 000000000..53d33c7b5 --- /dev/null +++ b/packages/jss-starter-kit/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2014-present Oleg Isonen/Slobodskoi & contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/jss-starter-kit/package.json b/packages/jss-starter-kit/package.json new file mode 100644 index 000000000..aa4a45e23 --- /dev/null +++ b/packages/jss-starter-kit/package.json @@ -0,0 +1,48 @@ +{ + "name": "jss-starter-kit", + "description": "A bundle to get you started playing with JSS. Not optimized for production deployment.", + "version": "9.8.4", + "license": "MIT", + "homepage": "https://cssinjs.org/", + "main": "dist/jss-starter-kit.cjs.js", + "module": "dist/jss-starter-kit.esm.js", + "unpkg": "dist/jss-starter-kit.bundle.js", + "typings": "./src/index.d.ts", + "author": { + "name": "Oleg Slobodskoi", + "email": "oleg008@gmail.com" + }, + "repository": { + "type": "git", + "url": "git@github.com:cssinjs/jss.git" + }, + "bugs": { + "url": "https://github.com/cssinjs/jss/issues/new" + }, + "files": [ + "dist", + "src", + "LICENSE" + ], + "keywords": [ + "jss", + "style", + "sheet", + "stylesheet", + "css", + "components", + "composable", + "css in js", + "css-in-js" + ], + "scripts": { + "build": "node ../../scripts/build.js", + "check-snapshot": "node ../../scripts/match-snapshot.js" + }, + "dependencies": { + "jss": "^9", + "jss-plugin-cache": "^3", + "jss-plugin-isolate": "^5", + "jss-preset-default": "^4" + } +} diff --git a/packages/jss-starter-kit/readme.md b/packages/jss-starter-kit/readme.md new file mode 100644 index 000000000..82ee304f4 --- /dev/null +++ b/packages/jss-starter-kit/readme.md @@ -0,0 +1,67 @@ +# jss-starter-kit:🚰 the whole kitchen sink + +[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/cssinjs/lobby) + +The `jss-starter-kit` combines all of the other [packages](https://github.com/cssinjs/jss/tree/master/packages) into a single bundle, to make it easy to import directly into a playground like Codepen, or a local HTML file. + +:warning: This bundle includes every JSS package, unminified. It's great for experimenting, but not suitable for production deployment. + +## Quick start + +There's an instance of JSS already set up with all of the default plugins, exported as `jss`. + +```javascript +import {jss} from 'https://unpkg.com/jss-starter-kit' + +// Notice that you can use camel-cased style keys here, because +// the default preset include jss-plugin-syntax-camel-case. If you want to use +// jss in your production application, you'll need to manually install the +// plugins you need. +const {classes} = jss + .createStyleSheet({ + wrapper: { + padding: 40, + background: '#f7df1e', + textAlign: 'center' + }, + title: { + font: { + size: 40, + weight: 900 + }, + color: '#24292e' + }, + link: { + color: '#24292e', + '&:hover': { + opacity: 0.5 + } + } + }) + .attach() + +document.body.innerHTML = ` +