@dboio/launchpad-icons 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +150 -0
- package/dist/assets/css/launchpad-icons.css +2457 -0
- package/dist/assets/css/launchpad-icons.min.css +8 -0
- package/dist/assets/fonts/launchpad-icons-lighter.woff2 +0 -0
- package/dist/assets/fonts/launchpad-icons-regular.woff2 +0 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 manolab, LLC. (dbo.io)
|
|
4
|
+
Developed by Christian Fillies
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# launchpad icons
|
|
2
|
+
Convert Sketch icons using fontello. Used Documentation from [dboio/icons](https://github.com/dboio/icons/blob/main/README.md) for Fontello use.
|
|
3
|
+
Fontello project to combine svgs and fonts into a single font for icons.
|
|
4
|
+
[Fontello](https://fontello.com/) is an online app that can generate fonts.
|
|
5
|
+
|
|
6
|
+
# documentation and builder
|
|
7
|
+
<a href="https://dboio.github.io/launchpad-icons/" target="_blank">Documentation</a>
|
|
8
|
+
|
|
9
|
+
<a href="https://dboio.github.io/launchpad-icons/#builder" target="_blank">Builder</a>
|
|
10
|
+
|
|
11
|
+
# install (consumers)
|
|
12
|
+
Published to npm as **[`@dboio/launchpad-icons`](https://www.npmjs.com/package/@dboio/launchpad-icons)**. Only the compiled CSS and fonts ship — no source, SVGs, or build tooling.
|
|
13
|
+
|
|
14
|
+
### npm
|
|
15
|
+
```sh
|
|
16
|
+
npm i @dboio/launchpad-icons
|
|
17
|
+
```
|
|
18
|
+
Import the stylesheet (relative font paths resolve automatically):
|
|
19
|
+
```js
|
|
20
|
+
import '@dboio/launchpad-icons' // launchpad-icons.css
|
|
21
|
+
import '@dboio/launchpad-icons/min' // launchpad-icons.min.css
|
|
22
|
+
```
|
|
23
|
+
Or link it directly:
|
|
24
|
+
```html
|
|
25
|
+
<link rel="stylesheet" href="node_modules/@dboio/launchpad-icons/dist/assets/css/launchpad-icons.min.css">
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### CDN (jsDelivr)
|
|
29
|
+
No install — pin a version (or use `@latest`):
|
|
30
|
+
```html
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@dboio/launchpad-icons@latest/dist/assets/css/launchpad-icons.min.css">
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Use icons with the `li-` prefix, e.g. `<i class="li-dbo"></i>`. See the [documentation](https://dboio.github.io/launchpad-icons/) for the full glyph list and modifiers.
|
|
35
|
+
|
|
36
|
+
> **Releasing:** publishing is automated — push a `v*.*.*` tag and `.github/workflows/release.yml` publishes to npm with provenance. A guard test (`npm test`) asserts the tarball never includes source or private files.
|
|
37
|
+
|
|
38
|
+
# setup local environment
|
|
39
|
+
The Following are required
|
|
40
|
+
* [node.js](https://nodejs.org/en/download/)
|
|
41
|
+
* [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
|
42
|
+
* [Homebrew](https://brew.sh/)
|
|
43
|
+
* [jq](https://macappstore.org/jq/) (when not automatically installed with npm install)
|
|
44
|
+
|
|
45
|
+
Run the following commands
|
|
46
|
+
1. `cd` into your local bin of the clone
|
|
47
|
+
2. `git clone https://github.com/dboio/icons`
|
|
48
|
+
3. `npm install fontello-cli -g`
|
|
49
|
+
4. `npm install` ~ for dependencies and additional third party fonts download
|
|
50
|
+
|
|
51
|
+
## Open Font on Fontello to Edit
|
|
52
|
+
Open the current config online
|
|
53
|
+
* `npm run regular:open` for [./font-weight/regular/]
|
|
54
|
+
* Executes `fontello-cli --config ./font-weight/regular/config.json open`
|
|
55
|
+
* `npm run lighter:open` for [./font-weight/lighter/]
|
|
56
|
+
* Executes `fontello-cli --config ./font-weight/lighter/config.json open`
|
|
57
|
+
* **WARNING!** The `fontello-cli` has an issue where the session is not cleared. So when switching to another font-weight you need to clear the browser cache and restart the browser. Make sure the `:open` opens the correct font-weight, else the session persists. If the issue still persists, use the "Import" option from the wrench menu on fontello.com, and pick the correct `config.json` manually.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Download and unpack the font as demo bin
|
|
61
|
+
* `fontello-cli --config config.json install`
|
|
62
|
+
|
|
63
|
+
## Install Fonts
|
|
64
|
+
Download and install into project bins
|
|
65
|
+
* `npm run regular:install`
|
|
66
|
+
* Executes `fontello-cli --config ./font-weight/regular/config.json --css ./src/css/ --font ./dist/assets/fonts/ install && npm run cleanup`
|
|
67
|
+
* `npm run lighter:install`
|
|
68
|
+
* Executes `fontello-cli --config ./font-weight/lighter/config.json --css ./src/css/ --font ./dist/assets/fonts/ install && npm run cleanup`
|
|
69
|
+
* **NOTE!** The font face `regular` is the basis for the character map. So for the distribution the only file that is required in the `src/css` directory is `launchpad-icons-regular-codes.css`.
|
|
70
|
+
* **NOTE!** Warning above!
|
|
71
|
+
|
|
72
|
+
## Build [SHORTHAND]
|
|
73
|
+
Allows running thru a stack of scripts that updates a font-weight based on the current browser session as well as deploys into the documentation directory.
|
|
74
|
+
* `npm run regular:build`
|
|
75
|
+
* `npm run lighter:build`
|
|
76
|
+
* **NOTE!** Warning above!
|
|
77
|
+
|
|
78
|
+
## Sorting Icon Lists by CSS Name
|
|
79
|
+
Sort icons for json glyphs
|
|
80
|
+
* `npm run sort`
|
|
81
|
+
* or the manual way
|
|
82
|
+
1. copy glyph array from json
|
|
83
|
+
2. paste into console and run
|
|
84
|
+
3. ```javascript
|
|
85
|
+
[].sort((a,b) => (a.css > b.css) ? 1 : ((b.css > a.css) ? -1 : 0));
|
|
86
|
+
```
|
|
87
|
+
4. copy returned object and paste back into json
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Sort icons by alphabet in demo.html page
|
|
91
|
+
* ```javascript
|
|
92
|
+
for (let r of Array.from(document.querySelectorAll('.span3')).sort((a,b) => (a.querySelector('.i-name').innerText > b.querySelector('.i-name').innerText) ? 1 : ((b.querySelector('.i-name').innerText > a.querySelector('.i-name').innerText) ? -1 : 0))) { document.getElementById('icons').appendChild(r) };
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Sketch Icons
|
|
96
|
+
* [Convert to Compound Paths](https://youtu.be/0ZZSafmcBYE)
|
|
97
|
+
* [Add to Fontello](https://youtu.be/eCdVHFruCp4)
|
|
98
|
+
|
|
99
|
+
## Compile and update docs
|
|
100
|
+
Compiles the SASS to CSS, minifies, stamps the version banner, and copies the result into `docs/` for the documentation site.
|
|
101
|
+
* `npm run prepare`
|
|
102
|
+
* Executes the following:
|
|
103
|
+
```
|
|
104
|
+
sass src/sass/launchpad-icons.sass dist/assets/css/launchpad-icons.css
|
|
105
|
+
csso dist/assets/css/launchpad-icons.css --output dist/assets/css/launchpad-icons.min.css
|
|
106
|
+
node scripts/banner.mjs # stamp the version banner — see "Versioning"
|
|
107
|
+
cp dist/assets/css/launchpad-icons.min.css docs/assets/css/launchpad-icons.css
|
|
108
|
+
cp -R dist/assets/fonts docs/assets
|
|
109
|
+
cp font-weight/regular/config.json docs/assets/js/config.json
|
|
110
|
+
npm run cleanup
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Versioning
|
|
114
|
+
The version lives in **one place**: `package.json`. The CSS banner is generated at build time by `scripts/banner.mjs` — never hand-type a version into the SASS source (it drifts).
|
|
115
|
+
* The banner is stamped onto `dist/assets/css/launchpad-icons.css` and `.min.css` *after* `sass` + `csso` run, so the minifier can't strip it.
|
|
116
|
+
* Version source: a GitHub release tag (`GITHUB_REF_NAME`, e.g. `v4.1.0`) wins when present — so a tagged release publishes under exactly that version — otherwise `package.json`'s `version`. The date is always the build date.
|
|
117
|
+
* To cut a release: `npm version <patch|minor|major>` then `git push --follow-tags`. The `v*.*.*` tag triggers the npm publish workflow.
|
|
118
|
+
|
|
119
|
+
## Automated builds (GitHub Actions)
|
|
120
|
+
`.github/workflows/build.yml` keeps the published CSS and the docs site in sync without a manual local build.
|
|
121
|
+
* On every push to `main` touching `src/**`, `font-weight/regular/config.json`, or `package.json`, it runs `npm run prepare` and commits the rebuilt `dist/` + `docs/` back to `main` (tagged `[skip ci]`, so it never retriggers itself).
|
|
122
|
+
* Trigger a rebuild manually from the **Actions** tab, or with `npm run trigger-build` (`gh workflow run build.yml`).
|
|
123
|
+
* `.github/workflows/release.yml` publishes to npm when a `v*.*.*` tag is pushed.
|
|
124
|
+
|
|
125
|
+
## Cleanup
|
|
126
|
+
Cleanup command removes unwanted files that are not needed for the compilation of files. This is also included in the `prepare` script.
|
|
127
|
+
* `npm run cleanup`
|
|
128
|
+
|
|
129
|
+
## Deploy to consuming projects
|
|
130
|
+
Copies the compiled CSS and the WOFF2 fonts (both weights) into the sibling projects, if they're checked out in parallel on your hard drive. Each `copy-to-*` is a plain filesystem copy; the `deploy-to-*` wrappers run `npm run prepare` first so you always ship a fresh build.
|
|
131
|
+
|
|
132
|
+
* **[LaunchpadOS](https://github.com/dboio/launchpad)** — `npm run copy-to-launchpad` (or `deploy-to-launchpad`)
|
|
133
|
+
* Copies `launchpad-icons.css`, `.min.css`, and both `.woff2` into `../launchpad/media/launchpad/app/assets/`.
|
|
134
|
+
* **Operator** — `npm run copy-to-operator` (or `deploy-to-operator`)
|
|
135
|
+
* Copies the CSS (plus `_media` variants) and both `.woff2` into `operator/lib/bins/app/assets/`.
|
|
136
|
+
* **dboio-web** — `npm run copy-to-dboio-web` (or `deploy-to-dboio-web`)
|
|
137
|
+
* Copies `launchpad-icons.min.css` and both `.woff2` into `dboio-web/lib/bins/web/assets/`. These are DBO-tracked assets — run `dbo push` from the dboio-web project to publish them to the server.
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## SASS Variables
|
|
141
|
+
* `$selected-support`: Default is `true` and sets all icons that have a `-solid` rendition as well, to **solid** when `.selected, *:active, *:focus` is met either on a parent element or the icon itself, so `<i class="li-alert selected"></i>` would be the same as `<i class="li-alert-solid"></i>`. In addition this will also trigger the selected/checked state of the selectable icons: `li-off`, `li-checkbox` and `li-radiobutton`.
|
|
142
|
+
* `$legacy-support`: Default is `true` and supports older classNaming convention:
|
|
143
|
+
* `li-clear-disc` is same as `li-clear-solid`
|
|
144
|
+
* `$base-unit`: Fallback value for when `--os-unit` is not found. Defaults to `3rem` (about 48px).
|
|
145
|
+
* `$font-name`: Defaults to `'launchpad-icons'`.
|
|
146
|
+
* `$font-path`: Defaults to `'../fonts'`. Sets the path where the font files reside.
|
|
147
|
+
* `$class-prefix`: Prefix for environment classes, such as `.os-modal`. Defaults to `'os-'`.
|
|
148
|
+
* `$rounded-box-class`: Default to `.li-rounded`, which will underlay the icon with a solid rounded box and scale down the graphic to 60%, while also inverting the icon color on top of the rounded box color. When SASS variable `$selected-support` is `true`, then this className is `.li-box`.
|
|
149
|
+
* `$circular-clipping-class`: Default to `.li-ellipse`, will clip (mask) the icon in a circular shape. If you apply a `background-color`, the icon `color` is inverted based on the `background-color` you applied. When SASS variable `$selected-support` is `true`, then this className is `.li-rounded`.
|
|
150
|
+
|