@symbo.ls/scratch
Advanced tools
Comparing version 0.7.8 to 0.7.9
@@ -5,3 +5,3 @@ { | ||
"author": "symbo.ls", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"files": [ | ||
@@ -15,2 +15,4 @@ "src" | ||
"dependencies": { | ||
"@domql/utils": "latest", | ||
"@symbo.ls/utils": "latest", | ||
"color-contrast-checker": "^1.5.0" | ||
@@ -25,6 +27,10 @@ }, | ||
"devDependencies": { | ||
"@babel/core": "^7.11.5", | ||
"@babel/preset-env": "^7.18.9", | ||
"@emotion/css": "^11.5.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-jest": "^27.0.2", | ||
"babel-preset-env": "^1.7.0", | ||
"coveralls": "^3.0.5", | ||
"eslint": "^6.1.0", | ||
"eslint-plugin-jest": "^24.1.0", | ||
@@ -34,6 +40,2 @@ "jest": "^27.0.6", | ||
"np": "^7.2.0", | ||
"@babel/core": "^7.11.5", | ||
"@emotion/css": "^11.5.0", | ||
"babel-eslint": "^10.0.3", | ||
"eslint": "^6.1.0", | ||
"parcel-bundler": "^1.12.3", | ||
@@ -40,0 +42,0 @@ "parcel-plugin-svg-sprite": "^1.4.1", |
'use strict' | ||
import { toDashCase } from '@symbo.ls/utils' | ||
import { UNIT } from '../defaultConfig' | ||
@@ -50,6 +51,2 @@ import { CONFIG } from '../factory' | ||
const dashize = val => val | ||
.replace(/[A-Z]/g, (match, offset) => (offset > 0 ? '-' : '') + match.toLowerCase()) | ||
.replace('.', '-') | ||
export const generateSubSequence = (props, sequenceProps) => { | ||
@@ -129,3 +126,3 @@ const { key, base, value, ratio, variable, index } = props | ||
const prefix = `--${dashize(sequenceProps.type.replace('.', '-'))}-` | ||
const prefix = `--${toDashCase(sequenceProps.type.replace('.', '-'))}-` | ||
@@ -154,2 +151,10 @@ const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i | ||
if (absValue.includes('+')) { | ||
const args = absValue.split('+') | ||
const varValue = v => `var(${prefix}${v}${mediaName})` | ||
const [first, second] = args | ||
const joint = `${varValue(first)} + ${varValue(second)}` | ||
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})` | ||
} | ||
// if subsequence is not set but value is applied | ||
@@ -156,0 +161,0 @@ if (!sequence[absValue] && absValue.length === 2) { |
41271
1279
3
+ Added@domql/utils@latest
+ Added@symbo.ls/utils@latest
+ Added@domql/utils@2.5.187(transitive)
+ Added@symbo.ls/utils@2.11.512(transitive)