Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@theme-ui/css

Package Overview
Dependencies
Maintainers
4
Versions
432
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@theme-ui/css - npm Package Compare versions

Comparing version 0.17.0 to 0.17.1-develop.0

6

package.json
{
"name": "@theme-ui/css",
"version": "0.17.0",
"version": "0.17.1-develop.0",
"source": "src/index.ts",

@@ -37,3 +37,3 @@ "main": "dist/theme-ui-css.cjs.js",

"dependencies": {
"csstype": "3.0.10"
"csstype": "^3.0.10"
},

@@ -46,3 +46,3 @@ "peerDependencies": {

"@types/react": "^18.2.12",
"@theme-ui/test-utils": "^0.17.0"
"@theme-ui/test-utils": "^0.17.1-develop.0"
},

@@ -49,0 +49,0 @@ "preconstruct": {

@@ -10,38 +10,2 @@ import { expecter } from '@theme-ui/test-utils'

describe('Theme', () => {
test('shows friendly error only on bad property', () => {
expectSnippet(`
css({
bg: 'salmon',
whiteSpace: 'no-works',
'> form': {
color: 'blue',
widows: 'bar',
// unknown CSS property is accepted
whitePace: 'this-works',
},
})
`).toFail(
/Error snippet\.tsx \(\d+,\d+\): Type '"no-works"' is not assignable to type [\s\S]+'./
)
})
test('shows friendly error on nested object', () => {
expectSnippet(`
css({
bg: 'salmon',
'> form': {
color: 'blue',
whiteSpace: 'banana',
},
})
`).toFail(
new RegExp(
`Error snippet\\.tsx \\(\\d+,\\d+\\): Type '{ color: "blue"; whiteSpace: "banana"; }'` +
` is not assignable to type '[\\s\\S]+'.\\n\\s+` +
`Types of property 'whiteSpace' are incompatible.\\n\\s+` +
`Type '"banana"' is not assignable to type [\\s\\S]+`
)
)
})
test('accepts unknown CSS property without error', () => {

@@ -100,5 +64,2 @@ expect(css({ '> form': { windows: 'baz' } })({})).toStrictEqual({

const parse = (x: string | number | undefined | {}) => parseInt(String(x))
css({
size: (t) => parse(t.space?.[3]) + parse(t.sizes?.[5]),
})

@@ -115,26 +76,2 @@ // Current limitation. If you broke this one, that's actually pretty awesome,

// This is not a feature, but the TypeScript chapter in the docs will need an
// update if this test fails.
test('inferred type `string` is too wide for `whiteSpace`', () => {
expectSnippet(`
const style = {
whiteSpace: 'pre-line'
}
css(style);
`).toFail(
/Type '{ whiteSpace: string; }' is not assignable to type 'ThemeUICSSObject'./
)
expectSnippet(`
import { ThemeUICSSObject } from './packages/css'
const style: ThemeUICSSObject = {
whiteSpace: 'pre-line'
}
css(style);
`).toSucceed()
})
describe('ColorMode', () => {

@@ -141,0 +78,0 @@ const expectedSnippet = expectSnippet(`

@@ -35,1 +35,8 @@ import { css, Theme, THEME_UI_DEFAULT_KEY } from '..'

})
// https://github.com/system-ui/theme-ui/issues/2520
it('accepts number as aspect ratio', () => {
const actual = css({ aspectRatio: 0.5 })({})
expect(actual).toStrictEqual({ aspectRatio: 0.5 })
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc