@solid-primitives/styles 0.0.104 → 0.0.105-beta.0

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.
Files changed (3) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +77 -77
  3. package/package.json +3 -3
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Solid Primitives Working Group
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Solid Primitives Working Group
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,77 +1,77 @@
1
- <p>
2
- <img width="100%" src="https://assets.solidjs.com/banner?type=Primitives&background=tiles&project=styles" alt="Solid Primitives styles">
3
- </p>
4
-
5
- # @solid-primitives/styles
6
-
7
- [![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
8
- [![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/styles?style=for-the-badge&label=size)](https://bundlephobia.com/package/@solid-primitives/styles)
9
- [![version](https://img.shields.io/npm/v/@solid-primitives/styles?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/styles)
10
- [![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-0.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
11
-
12
- Collection of reactive primitives focused on styles.
13
-
14
- - [`createRemSize`](#createRemSize) - Create a reactive signal of css `rem` size in pixels.
15
-
16
- ## Installation
17
-
18
- ```bash
19
- npm install @solid-primitives/styles
20
- # or
21
- yarn add @solid-primitives/styles
22
- # or
23
- pnpm add @solid-primitives/styles
24
- ```
25
-
26
- ## `createRemSize`
27
-
28
- Creates a reactive signal with value of the current rem size in pixels, and tracks it's changes.
29
-
30
- ### How to use it
31
-
32
- It takes no arguments and returns a number signal.
33
-
34
- ```ts
35
- import { createRemSize } from "@solid-primitives/styles";
36
-
37
- const remSize = createRemSize();
38
- console.log(remSize()); // 16
39
-
40
- createEffect(() => {
41
- console.log(remSize()); // remSize value will be logged on every change to the root font size
42
- });
43
- ```
44
-
45
- ### `useRemSize`
46
-
47
- This primitive provides a [shared root](https://github.com/solidjs-community/solid-primitives/tree/main/packages/rootless#createSharedRoot) variant that will reuse signals, HTML elements and the ResizeObserver instance across all dependents that use it.
48
-
49
- It's behavior is the same as [`createRemSize`](#createRemSize).
50
-
51
- ```ts
52
- import { useRemSize } from "@solid-primitives/styles";
53
-
54
- const remSize = useRemSize();
55
- console.log(remSize()); // 16
56
- ```
57
-
58
- ### Server fallback
59
-
60
- When using this primitive on the server, it will return a signal with a value of `16` by default. You can override this value by calling the `setServerRemSize` helper with a new value, before calling `createRemSize` or `useRemSize`.
61
-
62
- ```ts
63
- import { setServerRemSize, createRemSize } from "@solid-primitives/styles";
64
-
65
- setServerRemSize(10);
66
-
67
- const remSize = createRemSize();
68
- console.log(remSize()); // 10 instead of 16 (only on the server!)
69
- ```
70
-
71
- ## Demo
72
-
73
- TODO
74
-
75
- ## Changelog
76
-
77
- See [CHANGELOG.md](./CHANGELOG.md)
1
+ <p>
2
+ <img width="100%" src="https://assets.solidjs.com/banner?type=Primitives&background=tiles&project=styles" alt="Solid Primitives styles">
3
+ </p>
4
+
5
+ # @solid-primitives/styles
6
+
7
+ [![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
8
+ [![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/styles?style=for-the-badge&label=size)](https://bundlephobia.com/package/@solid-primitives/styles)
9
+ [![version](https://img.shields.io/npm/v/@solid-primitives/styles?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/styles)
10
+ [![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-0.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
11
+
12
+ Collection of reactive primitives focused on styles.
13
+
14
+ - [`createRemSize`](#createRemSize) - Create a reactive signal of css `rem` size in pixels.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @solid-primitives/styles
20
+ # or
21
+ yarn add @solid-primitives/styles
22
+ # or
23
+ pnpm add @solid-primitives/styles
24
+ ```
25
+
26
+ ## `createRemSize`
27
+
28
+ Creates a reactive signal with value of the current rem size in pixels, and tracks it's changes.
29
+
30
+ ### How to use it
31
+
32
+ It takes no arguments and returns a number signal.
33
+
34
+ ```ts
35
+ import { createRemSize } from "@solid-primitives/styles";
36
+
37
+ const remSize = createRemSize();
38
+ console.log(remSize()); // 16
39
+
40
+ createEffect(() => {
41
+ console.log(remSize()); // remSize value will be logged on every change to the root font size
42
+ });
43
+ ```
44
+
45
+ ### `useRemSize`
46
+
47
+ This primitive provides a [shared root](https://github.com/solidjs-community/solid-primitives/tree/main/packages/rootless#createSharedRoot) variant that will reuse signals, HTML elements and the ResizeObserver instance across all dependents that use it.
48
+
49
+ It's behavior is the same as [`createRemSize`](#createRemSize).
50
+
51
+ ```ts
52
+ import { useRemSize } from "@solid-primitives/styles";
53
+
54
+ const remSize = useRemSize();
55
+ console.log(remSize()); // 16
56
+ ```
57
+
58
+ ### Server fallback
59
+
60
+ When using this primitive on the server, it will return a signal with a value of `16` by default. You can override this value by calling the `setServerRemSize` helper with a new value, before calling `createRemSize` or `useRemSize`.
61
+
62
+ ```ts
63
+ import { setServerRemSize, createRemSize } from "@solid-primitives/styles";
64
+
65
+ setServerRemSize(10);
66
+
67
+ const remSize = createRemSize();
68
+ console.log(remSize()); // 10 instead of 16 (only on the server!)
69
+ ```
70
+
71
+ ## Demo
72
+
73
+ TODO
74
+
75
+ ## Changelog
76
+
77
+ See [CHANGELOG.md](./CHANGELOG.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solid-primitives/styles",
3
- "version": "0.0.104",
3
+ "version": "0.0.105-beta.0",
4
4
  "description": "Collection of reactive primitives focused on styles.",
5
5
  "author": "Damian Tarnawski <gthetaranv@gmail.com>",
6
6
  "contributors": [
@@ -92,8 +92,8 @@
92
92
  "css"
93
93
  ],
94
94
  "dependencies": {
95
- "@solid-primitives/rootless": "^1.2.5",
96
- "@solid-primitives/utils": "^5.2.1"
95
+ "@solid-primitives/rootless": "^1.2.6-beta.0",
96
+ "@solid-primitives/utils": "^5.4.0-beta.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "solid-js": "^1.6.0"