From 601e76086656b98c9a65acc148bc51779d154321 Mon Sep 17 00:00:00 2001 From: Evan Purcer Date: Tue, 6 Feb 2024 18:29:07 -0800 Subject: [PATCH] readme corrections --- LICENSE.md | 22 ++++++++++++++++++++++ README.md | 8 +++----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..fd57d5d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019 Evan Campbell Purcer + +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/README.md b/README.md index 5db8ce3..7446ffe 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,7 @@ The missing, well-typed link between HTML and CSS. \/_/ \/_/ \/_____/ \/_____/ namespace.style ``` -[![latest release](https://img.shields.io/github/release/evnp/namespace.style.svg)](https://github.com/evnp/namespace.style/releases/latest) [![npm package](https://img.shields.io/npm/v/namespace.style.svg)](https://www.npmjs.com/package/namespace.style) -[![license](https://img.shields.io/github/license/evnp/namespace.style.svg?color=blue)](https://github.com/evnp/namespace.style/blob/master/LICENSE.md) - Make element class names type-safe, typo-free, and autocompletable. - Make debugging DOM a dream – give everything a name you can actually understand. No generated hex soup. @@ -108,7 +106,7 @@ import { css } from "astroturf"; import { defineComponent } from "vue"; ``` -First we import the `nss` module as well as necessary Astroturf and Vue functions. +First we import the `nss` module as well as necessary [Astroturf](https://github.com/astroturfcss/astroturf) and Vue functions. ```typescript // Enums define available NSS elememt classes, and provide a "map" of component @@ -209,7 +207,7 @@ export const n = nss(Name, Elem, Cond, () return { SpecialList, Item, Ordered, Inline }; }); ``` -Finally, we have our CSS-in-JS setup using Astroturf. The NSS class management system can be used _without_ CSS-in-JS, in which case the NSS declaration would look much simpler: +Finally, we have our CSS-in-JS setup using [Astroturf](https://github.com/astroturfcss/astroturf). The NSS class management system can be used _without_ CSS-in-JS, in which case the NSS declaration would look much simpler: ```typescript export const n = nss(Name, Elem, Cond); ``` @@ -217,7 +215,7 @@ You'd use the `n` object in the exact same way in your template code. In this sh We `export const n` here so that it can be imported in test code as a type-aware source of element selectors. The export is only necessary if you want to use NSS externally from the component though. -There are many ways to map styles to NSS elements. The function which we're passing to `nss` above is one way – Astroturf generates vars containing unique class strings within it, and we return a mapping of NSS keys to these unique class strings. Instead of a function, you could also pass a simple object mapping here, or you could just use NSS classes directly within your styles – they're extremely human-readable. +There are many ways to map styles to NSS elements. The function which we're passing to `nss` above is one way – [Astroturf](https://github.com/astroturfcss/astroturf) generates vars containing unique class strings within it, and we return a mapping of NSS keys to these unique class strings. Instead of a function, you could also pass a simple object mapping here, or you could just use NSS classes directly within your styles – they're extremely human-readable. More docs are coming soon, until then please refer to NSS's extensive test cases for more usage examples: https://github.com/evnp/namespace.style/blob/main/test/nss.test.ts