Bun macro?
#1255
Replies: 1 comment
-
I just discovered that Parcel also added this and agree that this could be really useful. index.tsx import {css} from './css.ts' with {type: 'macro'};
<div className={css('color: red; &:hover { color: green }')}>
Hello!
</div> css.ts import type {MacroContext} from '@parcel/macros';
export async function css(this: MacroContext | void, code: string) {
let className = hash(code);
code = `.${className} { ${code} }`;
this?.addAsset({
type: 'css',
content: code
});
return className;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If we can use bun macro to directly generate inline classnames and .css files, then the development experience of VE in bun would be unparalleled.
Beta Was this translation helpful? Give feedback.
All reactions