Skip to content

Commit d9445d5

Browse files
committed
Feat: selector() API implement #236
1 parent aafcd1c commit d9445d5

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.changeset/great-buckets-clean.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@mincho-js/css": minor
3+
---
4+
5+
**css**
6+
7+
### New
8+
- Add `selector()` utility for computed property names

.changeset/strong-cases-grin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@mincho-js/css": patch
2+
"@mincho-js/css": minor
33
---
44

55
**rules**

packages/css/src/compat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export {
2121
export {
2222
globalCss as globalStyle,
2323
css as style,
24-
cssMultiple as styleVariants
24+
cssMultiple as styleVariants,
25+
selector
2526
} from "./css/index.js";
2627
export type { CSSRuleWith as StyleRuleWith } from "./css/types.js";
2728

packages/css/src/css/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ function processMultiple<T>(
238238
export function mincho$<T>(block: () => T) {
239239
return block();
240240
}
241+
242+
export function selector(selector: string): `&` {
243+
return selector as `&`;
244+
}
245+
241246
// == Tests ====================================================================
242247
// Ignore errors when compiling to CommonJS.
243248
// eslint-disable-next-line @typescript-eslint/ban-ts-comment

packages/css/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export {
2525
layer
2626
} from "@vanilla-extract/css";
2727

28-
export { globalCss, css } from "./css/index.js";
28+
export { globalCss, css, selector } from "./css/index.js";
2929
export type { CSSRuleWith } from "./css/types.js";
3030
export { rules } from "./rules/index.js";
3131
export type {

0 commit comments

Comments
 (0)