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

@mattsjones/css-core

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattsjones/css-core - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

7

CHANGELOG.md
# @mattsjones/css-core
## 0.0.10
### Patch Changes
- c94979f: Add `mapToStyles` function
## 0.0.9
### Patch Changes

@@ -5,0 +12,0 @@

2

dist/declarations/src/api.d.ts

@@ -7,2 +7,4 @@ import type { StyleRule } from './types';

export declare function style(rule: StyleRule, debugId?: string): string;
export declare function mapToStyles<StyleMap extends Record<string | number, StyleRule>>(styleMap: StyleMap, debugId?: string): Record<keyof StyleMap, string>;
export declare function mapToStyles<Data extends Record<string | number, unknown>>(data: Data, mapData: <Key extends keyof Data>(value: Data[Key], key: Key) => StyleRule, debugId?: string): Record<keyof Data, string>;
declare type ThemeVars<ThemeContract> = MapLeafNodes<ThemeContract, string>;

@@ -9,0 +11,0 @@ export declare function createThemeVars<ThemeContract>(themeContract: ThemeContract): ThemeVars<ThemeContract>;

@@ -122,2 +122,26 @@ 'use strict';

}
function mapToStyles(...args) {
if (typeof args[1] === 'function') {
const data = args[0];
const mapData = args[1];
const debugId = args[2];
const classMap = {};
for (const key in data) {
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
const styleMap = args[0];
const debugId = args[1];
const classMap = {};
for (const key in styleMap) {
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
function createThemeVars(themeContract) {

@@ -187,2 +211,3 @@ return walkObject(themeContract, (_value, path) => {

exports.createVar = createVar;
exports.mapToStyles = mapToStyles;
exports.style = style;

@@ -113,2 +113,26 @@ import { g as generateCss, s as sanitiseIdent } from './generateCss-a758bf8f.browser.esm.js';

}
function mapToStyles(...args) {
if (typeof args[1] === 'function') {
const data = args[0];
const mapData = args[1];
const debugId = args[2];
const classMap = {};
for (const key in data) {
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
const styleMap = args[0];
const debugId = args[1];
const classMap = {};
for (const key in styleMap) {
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
function createThemeVars(themeContract) {

@@ -173,2 +197,2 @@ return walkObject(themeContract, (_value, path) => {

export { createGlobalTheme, createInlineTheme, createTheme, createThemeVars, createVar, style };
export { createGlobalTheme, createInlineTheme, createTheme, createThemeVars, createVar, mapToStyles, style };

@@ -122,2 +122,26 @@ 'use strict';

}
function mapToStyles(...args) {
if (typeof args[1] === 'function') {
const data = args[0];
const mapData = args[1];
const debugId = args[2];
const classMap = {};
for (const key in data) {
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
const styleMap = args[0];
const debugId = args[1];
const classMap = {};
for (const key in styleMap) {
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
function createThemeVars(themeContract) {

@@ -187,2 +211,3 @@ return walkObject(themeContract, (_value, path) => {

exports.createVar = createVar;
exports.mapToStyles = mapToStyles;
exports.style = style;

@@ -111,2 +111,26 @@ 'use strict';

}
function mapToStyles(...args) {
if (typeof args[1] === 'function') {
const data = args[0];
const mapData = args[1];
args[2];
const classMap = {};
for (const key in data) {
classMap[key] = style(mapData(data[key], key));
}
return classMap;
}
const styleMap = args[0];
args[1];
const classMap = {};
for (const key in styleMap) {
classMap[key] = style(styleMap[key]);
}
return classMap;
}
function createThemeVars(themeContract) {

@@ -176,2 +200,3 @@ return walkObject(themeContract, (_value, path) => {

exports.createVar = createVar;
exports.mapToStyles = mapToStyles;
exports.style = style;

@@ -113,2 +113,26 @@ import { g as generateCss, s as sanitiseIdent } from './generateCss-addefd6f.esm.js';

}
function mapToStyles(...args) {
if (typeof args[1] === 'function') {
const data = args[0];
const mapData = args[1];
const debugId = args[2];
const classMap = {};
for (const key in data) {
classMap[key] = style(mapData(data[key], key), debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
const styleMap = args[0];
const debugId = args[1];
const classMap = {};
for (const key in styleMap) {
classMap[key] = style(styleMap[key], debugId ? `${debugId}_${key}` : key);
}
return classMap;
}
function createThemeVars(themeContract) {

@@ -173,2 +197,2 @@ return walkObject(themeContract, (_value, path) => {

export { createGlobalTheme, createInlineTheme, createTheme, createThemeVars, createVar, style };
export { createGlobalTheme, createInlineTheme, createTheme, createThemeVars, createVar, mapToStyles, style };

2

package.json
{
"name": "@mattsjones/css-core",
"version": "0.0.9",
"version": "0.0.10",
"main": "dist/mattsjones-css-core.cjs.js",

@@ -5,0 +5,0 @@ "module": "dist/mattsjones-css-core.esm.js",

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