Skip to content

Commit

Permalink
refactor: rename typed-css-utils to css-types
Browse files Browse the repository at this point in the history
  • Loading branch information
neoncitylights committed Dec 16, 2023
1 parent e751561 commit 1c5e1d4
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"node": "18",
"packages": [
"packages/types",
"packages/typed-css-utils",
"packages/css-types",
"packages/typed-http"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A monorepo of pure-TypeScript type packages.
## Packages

- [`@neoncitylights/types`](/packages/types): small library of general-purpose utility types
- [`@neoncitylights/typed-css-utils`](/packages/typed-css-utils): utilities for writing typed CSS in TypeScript
- [`@neoncitylights/css-types`](packages/css-types): utilities for writing typed CSS in TypeScript
- [`@neoncitylights/typed-http`](/packages/typed-http): strongly typed HTTP headers, methods, and status codes (supports Fetch, XHR, Node.js HTTP)

## License
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint:md": "markdownlint-cli2 '**/*.md' \"#node_modules\"",
"lint:md-fix": "npm run lint:md -- --fix",
"lint:md-env": "markdownlint-cli2 --version",
"lint:pub": "publint packages/types && publint packages/typed-css-utils",
"lint:pub": "publint packages/types && publint packages/css-types",
"lint:pub-env": "publint --version"
},
"devDependencies": {
Expand Down
24 changes: 12 additions & 12 deletions packages/typed-css-utils/README.md → packages/css-types/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# neoncitylights/typed-css-utils
# neoncitylights/css-types

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![NPM package](https://img.shields.io/npm/v/@neoncitylights/typed-css-utils?style=flat-square)](https://www.npmjs.com/package/@neoncitylights/typed-css-utils)
[![NPM package](https://img.shields.io/npm/v/@neoncitylights/css-types?style=flat-square)](https://www.npmjs.com/package/@neoncitylights/css-types)

This library provides a set of utilities extending the `csstype` package to help you write typed CSS in TypeScript.

Expand All @@ -13,24 +13,24 @@ Currently, there's basic support for the following W3C standards:
## Install

```
npm install @neoncitylights/typed-css-utils
npm install @neoncitylights/css-types
```

## Documentation

[Auto-generated API documentation is available](https://neoncitylights.github.io/typed-css-utils/).
[Auto-generated API documentation is available](https://neoncitylights.github.io/css-types/).

### API reference
>
> **Note**: The public API below is an excerpt and shows the *main* symbols that a developer is likely to use.
- `fn`: <a href="#cssSupports">#</a> **cssSupports**(*property*, *value*): *boolean*[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/cssSupports.html)
- `fn`: <a href="#matchMediaFeature">#</a> **matchMediaFeature**(*mediaFeature*, *value*): MediaQueryList • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/matchMediaFeature.html)
- `T`: <a href="#CSSProperty">#</a> cssSupports.**CSSProperty**[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/CSSProperty.html)
- `T`: <a href="#CSSPropertyValue">#</a> cssSupports.**CSSPropertyValue**[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/CSSPropertyValue.html)
- `T`: <a href="#MqFeature">#</a> matchMedia.**MqFeature**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MqFeature.html)
- `T`: <a href="#MqFeatureValue">#</a> matchMedia.**MqFeatureValue**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MqFeatureValue.html)
- `I`: <a href="#MediaQueries">#</a> matchMedia.**MediaQueries**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/typed-css-utils/types/MediaQueries.html)
- `fn`: <a href="#cssSupports">#</a> **cssSupports**(*property*, *value*): *boolean*[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/cssSupports.html)
- `fn`: <a href="#matchMediaFeature">#</a> **matchMediaFeature**(*mediaFeature*, *value*): MediaQueryList • [source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/matchMediaFeature.html)
- `T`: <a href="#CSSProperty">#</a> cssSupports.**CSSProperty**[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/CSSProperty.html)
- `T`: <a href="#CSSPropertyValue">#</a> cssSupports.**CSSPropertyValue**[source](./src/cssSupports.ts), [docs](https://neoncitylights.github.io/css-types/types/CSSPropertyValue.html)
- `T`: <a href="#MqFeature">#</a> matchMedia.**MqFeature**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MqFeature.html)
- `T`: <a href="#MqFeatureValue">#</a> matchMedia.**MqFeatureValue**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MqFeatureValue.html)
- `I`: <a href="#MediaQueries">#</a> matchMedia.**MediaQueries**[source](./src/matchMedia.ts), [docs](https://neoncitylights.github.io/css-types/types/MediaQueries.html)

## Usage

Expand All @@ -40,7 +40,7 @@ Using TypeScript, you can receive type intelliSense, which provides autocomplete
- Media feature names (e.g `prefers-color-scheme`, `aspect-ratio`)

```ts
import { matchMediaFeature, cssSupports } from '@neoncitylights/typed-css-utils';
import { matchMediaFeature, cssSupports } from '@neoncitylights/css-types';

// equivalent to window.matchMedia('(prefers-color-scheme: dark)');
const userPrefersDark: MediaQueryList = matchMediaFeature('prefers-color-scheme', 'dark');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@neoncitylights/typed-css-utils",
"name": "@neoncitylights/css-types",
"version": "0.2.0",
"description": "Improved TypeScript support for CSS and relevant APIs",
"license": "MIT",
Expand All @@ -11,7 +11,7 @@
"css",
"typescript"
],
"homepage": "https://github.com/neoncitylights/types/tree/main/packages/typed-css-utils",
"homepage": "https://github.com/neoncitylights/types/tree/main/packages/css-types",
"bugs": "https://github.com/neoncitylights/types/issues",
"repository": {
"type": "git",
Expand All @@ -22,12 +22,12 @@
"url": "https://github.com/sponsors/neoncitylights"
},
"type": "module",
"module": "./dist/typed-css-utils.es.js",
"module": "./dist/css-types.es.js",
"types": "./dist/index.d.ts",
"exports": {
"*": {
"types": "./dist/index.d.ts",
"import": "./dist/typed-css-utils.es.js"
"import": "./dist/css-types.es.js"
}
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type CSSPropertyValue<K extends CSSProperty> = Required<PropertiesHyphen[
*
* @example
* ```ts
* import { cssSupports } from '@neoncitylights/typed-css-utils';
* import { cssSupports } from '@neoncitylights/css-types';
*
* const supportsGrid = cssSupports('display', 'grid');
* const supportsFlex = cssSupports('display', 'flex');
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @example
* ```ts
* import { matchMediaFeature } from '@neoncitylights/typed-css-utils';
* import { matchMediaFeature } from '@neoncitylights/css-types';
*
* const userPrefersDark: MediaQueryList = matchMediaFeature('prefers-color-scheme', 'dark');
* const prefersLessMotion: MediaQueryList = matchMediaFeature('prefers-reduced-motion', 'reduce');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'typed-css-utils',
name: 'css-types',
formats: ['es'],
fileName: (format) => `typed-css-utils.${format}.js`,
fileName: (format) => `css-types.${format}.js`,
},
},
define: {
Expand Down

0 comments on commit 1c5e1d4

Please sign in to comment.