Skip to content

Commit 6c64795

Browse files
authored
🐛 fix(styles): adjust responsive helpers for the spacing and typography css util classes (#1611)
fix(styles): adjust responsive helpers for the spacing and typography css util classes
1 parent 4388c9a commit 6c64795

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.changeset/cool-islands-flash.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@baloise/ds-core': patch
3+
---
4+
5+
**styles**: adjust responsive helpers for the spacing and typography css util classes

libs/nx/src/executors/build-styles/generators/spacing.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BuildStylesExecutorSchema } from '../schema'
22
import * as utils from './utils'
3+
import { COLON_SEPARATOR } from './utils'
34

45
export const generateSpacing = async (options: BuildStylesExecutorSchema) => {
56
const tokens = await utils.getTokens({ token: 'size.space', ...options })
@@ -103,7 +104,8 @@ function generateSpace({ keys, prefix, property, breakpoint = '' }) {
103104
const values = {}
104105
for (const index in keys) {
105106
const key = keys[index]
106-
values[`${breakpoint}:${prefix}-${key}`] = `var(--bal-space-${key}${breakpoint ? `-${breakpoint}` : ''})`
107+
values[`${breakpoint}${COLON_SEPARATOR}${prefix}-${key}`] =
108+
`var(--bal-space-${key}${breakpoint && breakpoint !== 'mobile' ? `-${breakpoint}` : ''})`
107109
}
108110
const rules = utils.styleClass({ property, values, breakpoint, important: true })
109111
return { rules }
@@ -114,9 +116,11 @@ function generateSpace({ keys, prefix, property, breakpoint = '' }) {
114116
}
115117
for (const index in keys) {
116118
const key = keys[index]
117-
values[`${prefix}-${key}`] = `var(--bal-space-${key}${breakpoint ? `-${breakpoint}` : ''})`
119+
values[`${prefix}-${key}`] =
120+
`var(--bal-space-${key}${breakpoint && breakpoint !== 'mobile' ? `-${breakpoint}` : ''})`
118121
if (breakpoint) {
119-
values[`${breakpoint}:${prefix}-${key}`] = `var(--bal-space-${key}${breakpoint ? `-${breakpoint}` : ''})`
122+
values[`${breakpoint}${COLON_SEPARATOR}${prefix}-${key}`] =
123+
`var(--bal-space-${key}${breakpoint && breakpoint !== 'mobile' ? `-${breakpoint}` : ''})`
120124
}
121125
}
122126
const rules = utils.styleClass({ property, values, breakpoint, important: true })

libs/nx/src/executors/build-styles/generators/typography.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ const generateFontSizeRule = ({ keys, property, prefix, breakpoint = undefined }
9292
const values = {}
9393
for (const index in keys) {
9494
const key = keys[index]
95-
values[`${prefix}-${key}`] = `var(--bal-text-size-${key}${breakpoint ? `-${breakpoint}` : ''})`
95+
values[`${prefix}-${key}`] =
96+
`var(--bal-text-size-${key}${breakpoint && breakpoint !== 'mobile' ? `-${breakpoint}` : ''})`
9697
}
9798
return utils.styleClass({ property, values, important: true, breakpoint })
9899
}

0 commit comments

Comments
 (0)