emotion-solid
Advanced tools
Comparing version 1.1.1 to 2.1.0
{ | ||
"name": "emotion-solid", | ||
"version": "1.1.1", | ||
"version": "2.1.0", | ||
"description": "Emotion JS support for Solid JS projects.", | ||
@@ -16,3 +16,5 @@ "repository": "git@github.com:Acidic9/emotion-solid.git", | ||
"scripts": { | ||
"build": "rollup -c" | ||
"build": "rollup -c", | ||
"start": "rollup --watch -c", | ||
"test": "jest" | ||
}, | ||
@@ -22,5 +24,8 @@ "devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "^7.14.5", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-typescript": "^7.14.5", | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^15.12.5", | ||
"babel-preset-solid": "^1.0.0", | ||
"jest": "^27.5.1", | ||
"rollup": "^2.52.3", | ||
@@ -33,3 +38,5 @@ "rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"solid-jest": "^0.2.0", | ||
"solid-js": "^1.0.0", | ||
"ts-jest": "^27.1.4", | ||
"typescript": "^4.3.4" | ||
@@ -36,0 +43,0 @@ }, |
@@ -57,2 +57,27 @@ <h1 align="center">Emotion Solid</h1> | ||
## Themes | ||
You can pass theme to all your styled components with `ThemeProvider`. | ||
```ts | ||
import type { Component } from 'solid-js/web' | ||
import { ThemeProvider, styled } from 'emotion-solid' | ||
const StyledButton = styled('button')( | ||
({ theme }) => | ||
{ | ||
backgroundColor: theme.color, | ||
width: '100%', | ||
} | ||
) | ||
const App: Component = () => { | ||
const [theme, setTheme] = createSignal({color: 'green'}); | ||
return <ThemeProvider theme={theme}><Button>Click Me</Button></ThemeProvider> | ||
} | ||
``` | ||
Note that you have to pass accessor function that returns the theme object | ||
instead of just giving the theme object itself. | ||
## Contributing 🙌 | ||
@@ -59,0 +84,0 @@ |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
91
1
4314
19
3
0
2