From d8c078b53fb425fca25bfd950fa77217c2642ffd Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 15:04:53 +0100 Subject: [PATCH 01/11] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20group=20atoms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 1c0a4d11..e514f44b 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -1,58 +1,70 @@ 'use strict'; var atoms = exports.atoms = { + // Layout d: 'display', + bxz: 'box-sizing', + ov: 'overflow', + pos: 'position', + fl: 'float', + w: 'width', + h: 'height', + minW: 'min-width', + maxW: 'max-width', + minH: 'min-height', + maxH: 'max-height', + vis: 'visibility', + z: 'z-index', + // Margins mar: 'margin', mart: 'margin-top', marr: 'margin-right', marb: 'margin-bottom', marl: 'margin-left', + + // Paddings pad: 'padding', padt: 'padding-top', padr: 'padding-right', padb: 'padding-bottom', padl: 'padding-left', + // Borders bd: 'border', bdt: 'border-top', bdr: 'border-right', bdb: 'border-bottom', bdl: 'border-left', bdrad: 'border-radius', + out: 'outline', + // Colors col: 'color', op: 'opacity', bg: 'background', bgc: 'background-color', + // Text fz: 'font-size', fs: 'font-style', fw: 'font-weight', ff: 'font-family', - lh: 'line-height', - bxz: 'box-sizing', - cur: 'cursor', - ov: 'overflow', - pos: 'position', - ls: 'list-style', ta: 'text-align', td: 'text-decoration', - fl: 'float', - w: 'width', - minW: 'min-width', - maxW: 'max-width', - minH: 'min-height', - maxH: 'max-height', - h: 'height', - trs: 'transition', - out: 'outline', - vis: 'visibility', ww: 'word-wrap', - con: 'content', - z: 'z-index', + + // Pointer + cur: 'cursor', + + // Animations + trs: 'transition', tr: 'transform', + + // Other + ls: 'list-style', + con: 'content', }; exports.addon = function (renderer) { From 4a023e52850eecf7a3123740d0a87e5cace48a8b Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 15:09:33 +0100 Subject: [PATCH 02/11] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20publish=20teset=20co?= =?UTF-8?q?verage=20stats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gh-pages.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..ddd21553 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,26 @@ +name: Node.js CI + +on: + push: + branches: [ master ] + +jobs: + gh-pages: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - run: yarn install --frozen-lockfile + - run: yarn test --coverage + - name: Publish to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./coverage/lcov-report From f287069de2b799190e7a5ee4964fc910513e22aa Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 15:10:14 +0100 Subject: [PATCH 03/11] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20use=20v4=20of=20chec?= =?UTF-8?q?kout=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/checks.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 31e75231..88e6dffa 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -9,9 +9,9 @@ jobs: matrix: node-version: [20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: yarn diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53b369c6..a1faa8c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ jobs: matrix: node-version: [20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: yarn From fb0a3c82f295fdd7a8cdb4bd0fea260a47905138 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 15:27:40 +0100 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20more=20atoms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 88 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 16 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index e514f44b..51e3ab4e 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -1,11 +1,29 @@ 'use strict'; +var mr = 'margin', + mrt = 'margin-top', + mrr = 'margin-right', + mrb = 'margin-bottom', + mrl = 'margin-left' + pd = 'padding', + pdt = 'padding-top', + pdr = 'padding-right', + pdb = 'padding-bottom', + pdl = 'padding-left' + ; + var atoms = exports.atoms = { - // Layout - d: 'display', - bxz: 'box-sizing', - ov: 'overflow', + // Positioning pos: 'position', + t: 'top', + r: 'right', + b: 'bottom', + l: 'left', + z: 'z-index', + + // Layout (box model) + d: 'display', + vis: 'visibility', fl: 'float', w: 'width', h: 'height', @@ -13,22 +31,49 @@ var atoms = exports.atoms = { maxW: 'max-width', minH: 'min-height', maxH: 'max-height', - vis: 'visibility', - z: 'z-index', + ov: 'overflow', + ovx: 'overflow-x', + ovy: 'overflow-y', + bxz: 'box-sizing', + cl: 'clip', + clp: 'clip-path', + clr: 'clear', + + // Flexbox + fl: 'flex', + fld: 'flex-direction', + flg: 'flex-grow', + fls: 'flex-shrink', + flb: 'flex-basis', + flw: 'flex-wrap', + jc: 'justify-content', + ai: 'align-items', + ac: 'align-content', + as: 'align-self', // Margins - mar: 'margin', - mart: 'margin-top', - marr: 'margin-right', - marb: 'margin-bottom', - marl: 'margin-left', + mr, + mrt, + mrr, + mrb, + mrl, + mar: mr, + mart: mart, + marr: marr, + marb: marb, + marl: marl, // Paddings - pad: 'padding', - padt: 'padding-top', - padr: 'padding-right', - padb: 'padding-bottom', - padl: 'padding-left', + pd, + pdt, + pdr, + pdb, + pdl, + pad: pd, + padt: pdt, + padr: pdr, + padb: pdb, + padl: pdl, // Borders bd: 'border', @@ -44,6 +89,13 @@ var atoms = exports.atoms = { op: 'opacity', bg: 'background', bgc: 'background-color', + bgi: 'background-image', + bgr: 'background-repeat', + bga: 'background-attachment', + bgp: 'background-position', + bgs: 'background-size', + bgo: 'background-origin', + bgcl: 'background-clip', // Text fz: 'font-size', @@ -53,12 +105,16 @@ var atoms = exports.atoms = { lh: 'line-height', ta: 'text-align', td: 'text-decoration', + tt: 'text-transform', ww: 'word-wrap', // Pointer cur: 'cursor', + pe: 'pointer-events', + us: 'user-select', // Animations + an: 'animation', trs: 'transition', tr: 'transform', From 248e68ed4568875d91725db864649febb2f189ca Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 15:57:31 +0100 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20finalize=20new=20a?= =?UTF-8?q?tom=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 134 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 91 insertions(+), 43 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 51e3ab4e..0d48040e 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -1,43 +1,77 @@ 'use strict'; -var mr = 'margin', - mrt = 'margin-top', - mrr = 'margin-right', - mrb = 'margin-bottom', - mrl = 'margin-left' +var pos = 'position', + t = 'top', + r = 'right', + b = 'bottom', + l = 'left', + w = 'width', + h = 'height', + ov = 'overflow', + ovx = ov + '-x', + ovy = ov + '-y', + mr = 'margin', + mrt = mr + '-' + t, + mrr = mr + '-' + r, + mrb = mr + '-' + b, + mrl = mr + '-' + l, pd = 'padding', - pdt = 'padding-top', - pdr = 'padding-right', - pdb = 'padding-bottom', - pdl = 'padding-left' + pdt = pd + '-' + t, + pdr = pd + '-' + r, + pdb = pd + '-' + b, + pdl = pd + '-' + l, + bd = 'border', + bdt = bd + '-' + t, + bdr = bd + '-' + r, + bdb = bd + '-' + b, + bdl = bd + '-' + l, + bdrad = bd + '-radius', + bg = 'background', + bgc = bg + '-color', + bgi = bg + '-image', + bgr = bg + '-repeat', + bga = bg + '-attachment', + bgp = bg + '-position', + bgs = bg + '-size', + bgo = bg + '-origin', + bgcl = bg + '-clip', + f = 'font', + fz = f + '-size', + fs = f + '-style', + fw = f + '-weight', + ff = f + '-family' + st = 'stroke', + stw = st + '-width', + stl = st + '-linecap' ; var atoms = exports.atoms = { // Positioning - pos: 'position', - t: 'top', - r: 'right', - b: 'bottom', - l: 'left', + pos, + t, + r, + b, + l, z: 'z-index', // Layout (box model) d: 'display', vis: 'visibility', fl: 'float', - w: 'width', - h: 'height', - minW: 'min-width', - maxW: 'max-width', - minH: 'min-height', - maxH: 'max-height', - ov: 'overflow', - ovx: 'overflow-x', - ovy: 'overflow-y', + w, + h, + minW: 'min-' + w, + maxW: 'max-' + w, + minH: 'min-' + h, + maxH: 'max-' + h, + ov, + ovx, + ovy, bxz: 'box-sizing', cl: 'clip', clp: 'clip-path', clr: 'clear', + tbl: 'table-layout', // Flexbox fl: 'flex', @@ -76,37 +110,46 @@ var atoms = exports.atoms = { padl: pdl, // Borders - bd: 'border', - bdt: 'border-top', - bdr: 'border-right', - bdb: 'border-bottom', - bdl: 'border-left', - bdrad: 'border-radius', + bd, + bdt, + bdr, + bdb, + bdl, + bdrad, out: 'outline', + bxsh: 'box-shadow', // Colors col: 'color', op: 'opacity', - bg: 'background', - bgc: 'background-color', - bgi: 'background-image', - bgr: 'background-repeat', - bga: 'background-attachment', - bgp: 'background-position', - bgs: 'background-size', - bgo: 'background-origin', - bgcl: 'background-clip', + bg, + bgc, + bgi, + bgr, + bga, + bgp, + bgs, + bgo, + bgcl, + bdfl: 'backdrop-filter', + bfvis: 'backface-visibility', // Text - fz: 'font-size', - fs: 'font-style', - fw: 'font-weight', - ff: 'font-family', - lh: 'line-height', + f, + fz, + fs, + fw, + ff, ta: 'text-align', td: 'text-decoration', tt: 'text-transform', + ts: 'text-shadow', + tov: 'text-overflow', ww: 'word-wrap', + lts: 'letter-spacing', + ws: 'white-space', + lh: 'line-' + h, + va: 'vertical-align', // Pointer cur: 'cursor', @@ -118,6 +161,11 @@ var atoms = exports.atoms = { trs: 'transition', tr: 'transform', + // SVG + st, + stw, + stl, + // Other ls: 'list-style', con: 'content', From 00830dc0273a48244ad0aa550e179de911c881e9 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 18:08:29 +0100 Subject: [PATCH 06/11] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20adjust=20atom?= =?UTF-8?q?=20definition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 66 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 0d48040e..9a14eb6d 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -5,11 +5,23 @@ var pos = 'position', r = 'right', b = 'bottom', l = 'left', - w = 'width', - h = 'height', + w = 'width', + h = 'height', ov = 'overflow', + col = 'color', + con = 'content' ovx = ov + '-x', ovy = ov + '-y', + fl = 'flex', + fld = fl + '-direction', + flg = fl + '-grow', + fls = fl + '-shrink', + flb = fl + '-basis', + flw = fl + '-wrap', + align = 'align', + ai = align + '-items', + ac = align + '-' + con, + as = align + '-self', mr = 'margin', mrt = mr + '-' + t, mrr = mr + '-' + r, @@ -27,7 +39,7 @@ var pos = 'position', bdl = bd + '-' + l, bdrad = bd + '-radius', bg = 'background', - bgc = bg + '-color', + bgc = bg + '-' + col, bgi = bg + '-image', bgr = bg + '-repeat', bga = bg + '-attachment', @@ -35,11 +47,18 @@ var pos = 'position', bgs = bg + '-size', bgo = bg + '-origin', bgcl = bg + '-clip', + style = 'style', f = 'font', fz = f + '-size', - fs = f + '-style', + fs = f + '-' + style, fw = f + '-weight', ff = f + '-family' + text = 'text', + ta = text + '-align', + td = text + '-decoration', + tt = text + '-transform', + ts = text + '-shadow', + tov = text + '-overflow', st = 'stroke', stw = st + '-width', stl = st + '-linecap' @@ -57,7 +76,6 @@ var atoms = exports.atoms = { // Layout (box model) d: 'display', vis: 'visibility', - fl: 'float', w, h, minW: 'min-' + w, @@ -74,16 +92,16 @@ var atoms = exports.atoms = { tbl: 'table-layout', // Flexbox - fl: 'flex', - fld: 'flex-direction', - flg: 'flex-grow', - fls: 'flex-shrink', - flb: 'flex-basis', - flw: 'flex-wrap', - jc: 'justify-content', - ai: 'align-items', - ac: 'align-content', - as: 'align-self', + fl, + fld, + flg, + fls, + flb, + flw, + jc: 'justify-' + con, + ai, + ac, + as, // Margins mr, @@ -120,7 +138,7 @@ var atoms = exports.atoms = { bxsh: 'box-shadow', // Colors - col: 'color', + col, op: 'opacity', bg, bgc, @@ -140,16 +158,16 @@ var atoms = exports.atoms = { fs, fw, ff, - ta: 'text-align', - td: 'text-decoration', - tt: 'text-transform', - ts: 'text-shadow', - tov: 'text-overflow', + ta, + td, + tt, + ts, + tov, ww: 'word-wrap', lts: 'letter-spacing', ws: 'white-space', lh: 'line-' + h, - va: 'vertical-align', + va: 'vertical-' + align, // Pointer cur: 'cursor', @@ -167,8 +185,8 @@ var atoms = exports.atoms = { stl, // Other - ls: 'list-style', - con: 'content', + ls: 'list-' + style, + con, }; exports.addon = function (renderer) { From 8debe40d1e56d80363cdb457f382a89c258f0cf4 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 19:42:03 +0100 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20TypeScript?= =?UTF-8?q?=20atom=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.d.ts | 524 ++++++++++++++++++++++++++++++++++++++--------- addon/atoms.js | 2 + 2 files changed, 434 insertions(+), 92 deletions(-) diff --git a/addon/atoms.d.ts b/addon/atoms.d.ts index 04a5ed14..6b349c14 100644 --- a/addon/atoms.d.ts +++ b/addon/atoms.d.ts @@ -4,240 +4,580 @@ import {NanoRenderer} from '../types/nano'; type TLength = string | number; export interface Atoms { + /** - * Short for `display` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `font-size` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - d?: CSS.Property.Display; + fz?: CSS.Property.FontSize; /** - * Short for `margin` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `font-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - mar?: CSS.Property.Margin; + fs?: CSS.Property.FontStyle; /** - * Short for `margin-top` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `font-weight` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - mart?: CSS.Property.MarginBottom; + fw?: CSS.Property.FontWeight; /** - * Short for `margin-right` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `font-family` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - marr?: CSS.Property.MarginBottom; + ff?: CSS.Property.FontFamily; /** - * Short for `margin-bottom` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `line-height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - marb?: CSS.Property.MarginBottom; + lh?: CSS.Property.LineHeight; /** - * Short for `margin-left` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `cursor` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - marl?: CSS.Property.MarginBottom; + cur?: CSS.Property.Cursor; /** - * Short for `padding` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `list-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - pad?: CSS.Property.Padding; + ls?: CSS.Property.ListStyle; /** - * Short for `padding-top` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `text-align` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - padt?: CSS.Property.PaddingBottom; + ta?: CSS.Property.TextAlign; /** - * Short for `padding-right` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `text-decoration` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - padr?: CSS.Property.PaddingBottom; + td?: CSS.Property.TextDecoration; /** - * Short for `padding-bottom` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `transition` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - padb?: CSS.Property.PaddingBottom; + trs?: CSS.Property.Transition; /** - * Short for `padding-left` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `word-wrap` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - padl?: CSS.Property.PaddingBottom; + ww?: CSS.Property.WordWrap; /** - * Short for `border` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `content` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bd?: CSS.Property.BorderBottom; + con?: CSS.Property.Content; /** - * Short for `border-top` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `transform` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bdt?: CSS.Property.BorderBottom; + tr?: CSS.Property.Transform; + + + + + // Positioning + /** - * Short for `border-right` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `position` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bdr?: CSS.Property.BorderBottom; + pos?: CSS.Property.Position; /** - * Short for `border-bottom` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `top` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bdb?: CSS.Property.BorderBottom; + t?: CSS.Property.Top; /** - * Short for `border-left` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `right` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bdl?: CSS.Property.BorderBottom; + r?: CSS.Property.Right; /** - * Short for `border-radius` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `bottom` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bdrad?: CSS.Property.BorderRadius; + b?: CSS.Property.Bottom; /** - * Short for `color` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `left` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - col?: CSS.Property.Color; + l?: CSS.Property.Left; /** - * Short for `opacity` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `z-index` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - op?: number | string; + z?: CSS.Property.ZIndex; + + + // Layout (box model) /** - * Short for `background` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `display` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bg?: CSS.Property.Background; + d?: CSS.Property.Display; /** - * Short for `background-color` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `visibility` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - bgc?: CSS.Property.BackgroundColor; + vis?: CSS.Property.Visibility; /** - * Short for `font-size` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `width` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - fz?: CSS.Property.FontSize; + w?: CSS.Property.Width; /** - * Short for `font-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `min-width` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - fs?: CSS.Property.FontStyle; + minW?: CSS.Property.MinWidth; /** - * Short for `font-weight` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `max-width` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - fw?: CSS.Property.FontWeight; + maxW?: CSS.Property.MaxWidth; /** - * Short for `font-family` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `height` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - ff?: CSS.Property.FontFamily; + h?: CSS.Property.Height; /** - * Short for `line-height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `min-height` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - lh?: CSS.Property.LineHeight; + minH?: CSS.Property.MinHeight; + + /** + * Short for `max-height` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + maxH?: CSS.Property.MaxHeight; + + /** + * Short for `overflow` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ov?: CSS.Property.Overflow; + + /** + * Short for `overflow-x` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ovx?: CSS.Property.OverflowX; /** - * Short for `box-sizing` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `overflow-y` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ovy?: CSS.Property.OverflowX; + + /** + * Short for `box-sizing` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ bxz?: CSS.Property.BoxSizing; + + /** + * Short for `clip` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + cl?: CSS.Property.Clip; /** - * Short for `cursor` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `clip-path` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - cur?: CSS.Property.Cursor; + clp?: CSS.Property.ClipPath; /** - * Short for `overflow` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `table-layout` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - ov?: CSS.Property.Overflow; + clr?: CSS.Property.Clear; /** - * Short for `position` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `table-layout` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - pos?: CSS.Property.Position; + tbl?: CSS.Property.TableLayout; + + + // Flexbox /** - * Short for `list-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - ls?: CSS.Property.ListStyle; + fl?: CSS.Property.Flex; /** - * Short for `text-align` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex-direction` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - ta?: CSS.Property.TextAlign; + fld?: CSS.Property.FlexDirection; /** - * Short for `text-decoration` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex-grow` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - td?: CSS.Property.TextDecoration; + flg?: CSS.Property.FlexGrow; /** - * Short for `float` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex-shrink` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - fl?: CSS.Property.Float; + fls?: CSS.Property.FlexShrink; /** - * Short for `width` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex-basis` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - w?: CSS.Property.Width; + flb?: CSS.Property.FlexBasis; /** - * Short for `min-width` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `flex-wrap` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - minW?: CSS.Property.MinWidth; + flw?: CSS.Property.FlexWrap; /** - * Short for `max-width` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `justify-content` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - maxW?: CSS.Property.MaxWidth; + jc?: CSS.Property.JustifyContent; /** - * Short for `min-height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `align-items` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - minH?: CSS.Property.MinHeight; + ai?: CSS.Property.AlignItems; /** - * Short for `max-height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `align-content` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - maxH?: CSS.Property.MaxHeight; + ac?: CSS.Property.AlignContent; /** - * Short for `height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `align-self` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - h?: CSS.Property.Height; + as?: CSS.Property.AlignSelf; + + + // Margins /** - * Short for `transition` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `margin` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - trs?: CSS.Property.Transition; + mr?: CSS.Property.Margin; + + /** + * Short for `margin-top` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + mrt?: CSS.Property.MarginTop; /** - * Short for `outline` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `margin-right` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + mrr?: CSS.Property.MarginRight; + + /** + * Short for `margin-bottom` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + mrb?: CSS.Property.MarginBottom; + + /** + * Short for `margin-left` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + mrl?: CSS.Property.MarginLeft; + + /** + * Same as `mr`. + * @deprecated Use `mr` instead. + */ + mar?: CSS.Property.Margin; + + /** + * Same as `mrt`. + * @deprecated Use `mrt` instead. + */ + mart?: CSS.Property.MarginTop; + + /** + * Same as `mrr`. + * @deprecated Use `mrr` instead. + */ + marr?: CSS.Property.MarginRight; + + /** + * Same as `mrb`. + * @deprecated Use `mrb` instead. + */ + marb?: CSS.Property.MarginBottom; + + /** + * Same as `mrl`. + * @deprecated Use `mrl` instead. + */ + marl?: CSS.Property.MarginLeft; + + // Paddings + + /** + * Short for `padding` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pd?: CSS.Property.Padding; + + /** + * Short for `padding-top` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pdt?: CSS.Property.PaddingTop; + + /** + * Short for `padding-right` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pdr?: CSS.Property.PaddingRight; + + /** + * Short for `padding-bottom` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pdb?: CSS.Property.PaddingBottom; + + /** + * Short for `padding-left` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pdl?: CSS.Property.PaddingLeft; + + /** + * Same as `pd`. + * @deprecated Use `pd` instead. + */ + pad?: CSS.Property.Padding; + + /** + * Same as `pdt`. + * @deprecated Use `pdt` instead. + */ + padt?: CSS.Property.PaddingTop; + + /** + * Same as `pdr`. + * @deprecated Use `pdr` instead. + */ + padr?: CSS.Property.PaddingRight; + + /** + * Same as `pdb`. + * @deprecated Use `pdb` instead. + */ + padb?: CSS.Property.PaddingBottom; + + /** + * Same as `pdl`. + * @deprecated Use `pdl` instead. + */ + padl?: CSS.Property.PaddingLeft; + + + // Borders + + /** + * Short for `border` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bd?: CSS.Property.BorderBottom; + + /** + * Short for `border-top` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdt?: CSS.Property.BorderTop; + + /** + * Short for `border-right` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdr?: CSS.Property.BorderRight; + + /** + * Short for `border-bottom` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdb?: CSS.Property.BorderBottom; + + /** + * Short for `border-left` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdl?: CSS.Property.BorderLeft; + + /** + * Short for `border-radius` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdrad?: CSS.Property.BorderRadius; + + /** + * Short for `border-color` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdc?: CSS.Property.BorderColor; + + /** + * Short for `border-style` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bds?: CSS.Property.BorderStyle; + + /** + * Short for `outline` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ out?: CSS.Property.Outline; /** - * Short for `visibility` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `box-shadow` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - vis?: CSS.Property.Visibility; + bxsh?: CSS.Property.BoxShadow; + + + // Colors /** - * Short for `word-wrap` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `color` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - ww?: CSS.Property.WordWrap; + col?: CSS.Property.Color; /** - * Short for `content` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `opacity` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - con?: CSS.Property.Content; + op?: number | string; /** - * Short for `z-index` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `background` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - z?: CSS.Property.ZIndex; + bg?: CSS.Property.Background; /** - * Short for `transform` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + * Short for `background-color` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ - tr?: CSS.Property.Transform; + bgc?: CSS.Property.BackgroundColor; + + /** + * Short for `background-image` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgi?: CSS.Property.BackgroundImage; + + /** + * Short for `background-repeat` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgr?: CSS.Property.BackgroundRepeat; + + /** + * Short for `background-attachment` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bga?: CSS.Property.BackgroundAttachment; + + /** + * Short for `background-position` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgp?: CSS.Property.BackgroundPosition; + + /** + * Short for `background-size` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgs?: CSS.Property.BackgroundSize; + + /** + * Short for `background-origin` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgo?: CSS.Property.BackgroundOrigin; + + /** + * Short for `background-clip` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bgcl?: CSS.Property.BackgroundClip; + + /** + * Short for `backdrop-filter` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bdfl?: CSS.Property.BackdropFilter; + + /** + * Short for `backface-visibility` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + bfvis?: CSS.Property.BackfaceVisibility; + + // // Text + // f, + // fz, + // fs, + // fw, + // ff, + // ta, + // td, + // tt, + // ts, + // tov, + // ww: 'word-wrap', + // lts: 'letter-spacing', + // ws: 'white-space', + // lh: 'line-' + h, + // va: 'vertical-' + align, + + // // Pointer + // cur: 'cursor', + // pe: 'pointer-events', + // us: 'user-select', + + // // Animations + // an: 'animation', + // trs: 'transition', + // tr: 'transform', + + // // SVG + // st, + // stw, + // stl, + + // // Other + // ls: 'list-' + style, + // con, } export function addon(nano: NanoRenderer); diff --git a/addon/atoms.js b/addon/atoms.js index 9a14eb6d..03aec18a 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -134,6 +134,8 @@ var atoms = exports.atoms = { bdb, bdl, bdrad, + bdc: bd + '-' + col, + bds: bd + '-' + style, out: 'outline', bxsh: 'box-shadow', From 0ca247da04241af4a228f118919856a0f839d971 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 19:44:08 +0100 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20comman=20oper?= =?UTF-8?q?ators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 03aec18a..8d18df0d 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -9,7 +9,7 @@ var pos = 'position', h = 'height', ov = 'overflow', col = 'color', - con = 'content' + con = 'content', ovx = ov + '-x', ovy = ov + '-y', fl = 'flex', @@ -52,7 +52,7 @@ var pos = 'position', fz = f + '-size', fs = f + '-' + style, fw = f + '-weight', - ff = f + '-family' + ff = f + '-family', text = 'text', ta = text + '-align', td = text + '-decoration', From 90a44053c411a2803cb4fdfcf0c65e07103b42f7 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 20:20:44 +0100 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20more=20anima?= =?UTF-8?q?tion-*=20atoms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 8d18df0d..3c7d4d89 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -62,6 +62,8 @@ var pos = 'position', st = 'stroke', stw = st + '-width', stl = st + '-linecap' + an = 'animation', + ann = an + '-name' ; var atoms = exports.atoms = { @@ -170,14 +172,20 @@ var atoms = exports.atoms = { ws: 'white-space', lh: 'line-' + h, va: 'vertical-' + align, - + // Pointer cur: 'cursor', pe: 'pointer-events', us: 'user-select', // Animations - an: 'animation', + an, + ann, + and: an + '-duration', + anf: an + '-fill-mode', + anit: an + '-iteration-count', + anp: an + '-play-state', + ant: an + '-timing-function', trs: 'transition', tr: 'transform', From 4b37ed5915f560fa2232a3fa99d612a12c6ff346 Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 20:23:15 +0100 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20finalize=20atom=20?= =?UTF-8?q?TypeScript=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.d.ts | 316 +++++++++++++++++++++++++++++++---------------- 1 file changed, 208 insertions(+), 108 deletions(-) diff --git a/addon/atoms.d.ts b/addon/atoms.d.ts index 6b349c14..6875be1f 100644 --- a/addon/atoms.d.ts +++ b/addon/atoms.d.ts @@ -4,78 +4,8 @@ import {NanoRenderer} from '../types/nano'; type TLength = string | number; export interface Atoms { - - /** - * Short for `font-size` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - fz?: CSS.Property.FontSize; - - /** - * Short for `font-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - fs?: CSS.Property.FontStyle; - - /** - * Short for `font-weight` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - fw?: CSS.Property.FontWeight; - - /** - * Short for `font-family` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - ff?: CSS.Property.FontFamily; - - /** - * Short for `line-height` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - lh?: CSS.Property.LineHeight; - - /** - * Short for `cursor` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - cur?: CSS.Property.Cursor; - - /** - * Short for `list-style` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - ls?: CSS.Property.ListStyle; - - /** - * Short for `text-align` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - ta?: CSS.Property.TextAlign; - - /** - * Short for `text-decoration` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - td?: CSS.Property.TextDecoration; - - /** - * Short for `transition` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - trs?: CSS.Property.Transition; - - /** - * Short for `word-wrap` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - ww?: CSS.Property.WordWrap; - - /** - * Short for `content` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - con?: CSS.Property.Content; - - /** - * Short for `transform` property. Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). - */ - tr?: CSS.Property.Transform; - - - - - // Positioning - + /** * Short for `position` property. * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). @@ -186,7 +116,7 @@ export interface Atoms { * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ bxz?: CSS.Property.BoxSizing; - + /** * Short for `clip` property. * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). @@ -443,7 +373,7 @@ export interface Atoms { * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). */ bdc?: CSS.Property.BorderColor; - + /** * Short for `border-style` property. * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). @@ -543,41 +473,211 @@ export interface Atoms { */ bfvis?: CSS.Property.BackfaceVisibility; - // // Text - // f, - // fz, - // fs, - // fw, - // ff, - // ta, - // td, - // tt, - // ts, - // tov, - // ww: 'word-wrap', - // lts: 'letter-spacing', - // ws: 'white-space', - // lh: 'line-' + h, - // va: 'vertical-' + align, - - // // Pointer - // cur: 'cursor', - // pe: 'pointer-events', - // us: 'user-select', - - // // Animations - // an: 'animation', - // trs: 'transition', - // tr: 'transform', - - // // SVG - // st, - // stw, - // stl, - - // // Other - // ls: 'list-' + style, - // con, + // Text + + /** + * Short for `font` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + f?: CSS.Property.Font; + + /** + * Short for `font-size` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + fz?: CSS.Property.FontSize; + + /** + * Short for `font-style` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + fs?: CSS.Property.FontStyle; + + /** + * Short for `font-weight` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + fw?: CSS.Property.FontWeight; + + /** + * Short for `font-family` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ff?: CSS.Property.FontFamily; + + /** + * Short for `text-align` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ta?: CSS.Property.TextAlign; + + /** + * Short for `text-decoration` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + td?: CSS.Property.TextDecoration; + + /** + * Short for `text-transform` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + tt?: CSS.Property.TextTransform; + + /** + * Short for `text-shadow` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ts?: CSS.Property.TextShadow; + + /** + * Short for `text-overflow` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + tov?: CSS.Property.TextOverflow; + + /** + * Short for `word-wrap` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ww?: CSS.Property.WordWrap; + + /** + * Short for `letter-spacing` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + lts?: CSS.Property.LetterSpacing; + + /** + * Short for `white-space` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ws?: CSS.Property.WhiteSpace; + + /** + * Short for `line-height` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + lh?: CSS.Property.LineHeight; + + /** + * Short for `vertical-align` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + va?: CSS.Property.VerticalAlign; + + + // Pointer + + /** + * Short for `cursor` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + cur?: CSS.Property.Cursor; + + /** + * Short for `pointer-events` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + pe?: CSS.Property.PointerEvents; + + /** + * Short for `user-select` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + us?: CSS.Property.UserSelect; + + + // Animations + + /** + * Short for `animation` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + an?: CSS.Property.Animation; + + /** + * Short for `animation-name` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ann?: CSS.Property.AnimationName; + + /** + * Short for `animation-duration` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + and?: CSS.Property.AnimationDuration; + + /** + * Short for `animation-fill-mode` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + anf?: CSS.Property.AnimationFillMode; + + /** + * Short for `animation-iteration-count` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + anit?: CSS.Property.AnimationIterationCount; + + /** + * Short for `animation-play-state` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + anp?: CSS.Property.AnimationPlayState; + + /** + * Short for `animation-timing-function` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ant?: CSS.Property.AnimationTimingFunction; + + /** + * Short for `transition` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + trs?: CSS.Property.Transition; + + /** + * Short for `transform` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + tr?: CSS.Property.Transform; + + + // SVG + + /** + * Short for `stroke` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + st?: CSS.Property.Stroke; + + /** + * Short for `stroke-width` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + stw?: CSS.Property.StrokeWidth; + + /** + * Short for `stroke-linecap` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + stl?: CSS.Property.StrokeLinecap; + + + // Other + + /** + * Short for `list-style` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + ls?: CSS.Property.ListStyle; + + /** + * Short for `content` property. + * Requires [`atoms` addon](https://github.com/streamich/nano-css/blob/master/docs/atoms.md). + */ + con?: CSS.Property.Content; } export function addon(nano: NanoRenderer); From d7c98b10b86c50837afd8b742a25c4ee70b6a9ae Mon Sep 17 00:00:00 2001 From: streamich Date: Mon, 20 Nov 2023 20:25:04 +0100 Subject: [PATCH 11/11] =?UTF-8?q?fix:=20=F0=9F=90=9B=20correct=20syntax=20?= =?UTF-8?q?errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/atoms.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/atoms.js b/addon/atoms.js index 3c7d4d89..d0a209c5 100644 --- a/addon/atoms.js +++ b/addon/atoms.js @@ -61,7 +61,7 @@ var pos = 'position', tov = text + '-overflow', st = 'stroke', stw = st + '-width', - stl = st + '-linecap' + stl = st + '-linecap', an = 'animation', ann = an + '-name' ; @@ -112,10 +112,10 @@ var atoms = exports.atoms = { mrb, mrl, mar: mr, - mart: mart, - marr: marr, - marb: marb, - marl: marl, + mart: mrt, + marr: mrr, + marb: mrb, + marl: mrl, // Paddings pd,