@weser/styling 0.0.13 → 0.0.15
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/README.md +2 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
# @weser/
|
|
1
|
+
# @weser/styling
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
# npm
|
|
9
|
-
npm i --save @weser/context
|
|
10
|
-
# yarn
|
|
11
|
-
yarn add @weser/context
|
|
12
|
-
# pnpm
|
|
13
|
-
pnpm add @weser/context
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Documentation
|
|
17
|
-
|
|
18
|
-
### `createContext<T>`
|
|
19
|
-
|
|
20
|
-
#### Parameters
|
|
21
|
-
|
|
22
|
-
| Parameter | Type | Default | Description |
|
|
23
|
-
| ------------ | --------- | ------- | -------------------------------------------------------- |
|
|
24
|
-
| defaultValue | `T` | `null` | The default value for when no provider is used |
|
|
25
|
-
| name | `string` | `""` | (Optional) A name for the context used in error messages |
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { createContext } from '@weser/context'
|
|
29
|
-
|
|
30
|
-
type Theme = 'light' | 'dark'
|
|
31
|
-
|
|
32
|
-
const [useTheme, ThemeProvider] = createContext<Theme>('light', 'theme')
|
|
33
|
-
|
|
34
|
-
function App({ children }) {
|
|
35
|
-
return <ThemeProvider value="dark">{children}</ThemeProvider>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Component() {
|
|
39
|
-
const theme = useTheme()
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div style={{ backgroundColor: theme === 'dark' ? 'black' : 'white' }}>
|
|
43
|
-
Hello
|
|
44
|
-
</div>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## License
|
|
50
|
-
|
|
51
|
-
@weser/context is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>
|
|
52
|
-
Documentation is licensed under [Creative Common License](http://creativecommons.org/licenses/by/4.0/).<br>
|
|
53
|
-
Created with ♥ by [@robinweser](http://weser.io).
|
|
3
|
+
[Documentation](https://packages.weser.io/styling)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weser/styling",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Utils for styling with CSS hooks",
|
|
5
5
|
"author": "Robin Weser <robin@weser.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"styles-debugger": "^1.0.0",
|
|
58
58
|
"typescript": "^5.9.2"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "09f1d19b11a34e519fd35cf91cede2b75f38356c"
|
|
61
61
|
}
|