Attributify's attribute `align` doesn't work in SolidJS's `<div>` element
See original GitHub issueAs the title says, I tried to use the align
attribute on the <div>
element in SolidJS, but it didn’t work.
// App.tsx
function App() {
return (
<div h="50px" flex="~" justify="around" align="items-center">
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
</div>
);
}
export default App;
Maybe because the align
attribute is an attribute of the HTMLDivElement, I added the align
attribute into the ignoreAttributes
list, and used the un-align
instead, but still not working.
// vite.config.ts
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import unocssPlugin from 'unocss/vite';
import presetUno from '@unocss/preset-uno';
import presetAttributify from '@unocss/preset-attributify';
export default defineConfig({
plugins: [
solidPlugin(),
unocssPlugin({
presets: [
presetUno(),
presetAttributify({ ignoreAttributes: ['align'] }),
],
}),
],
server: {
port: 3000,
},
build: {
target: 'esnext',
},
});
// App.tsx
function App() {
return (
<div h="50px" flex="~" justify="around" un-align="items-center">
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
</div>
);
}
export default App;
This is the reproduction link: https://stackblitz.com/edit/reproduce-uno-solid-attributify-bug?file=src%2FApp.jsx,vite.config.js
Is this an UnoCSS bug? If it is, I’m more than willing to fix it, and need some guidance.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Boolean attributes · Issue #1101 · solidjs/solid - GitHub
Current behavior in Solid: Assume const Div = (props) => <... ... JSX attributes foo and foo={true} behave for an HTML element, as...
Read more >Documentation - SolidJS · Reactive Javascript Library
The createSignal function returns a pair of functions as a two-element array: a getter (or accessor) and a setter. In typical use, you...
Read more >Bindings/Refs - SolidJS · Reactive Javascript Library
You can always get a reference to a DOM element in Solid through assignment, since JSX creates actual DOM elements. For example: const...
Read more >Guides:Rendering - SolidJS · Reactive Javascript Library
The majority of all attributes on native element JSX are set as DOM attributes. Static values are built right into the template that...
Read more >Bindings/Forwarding Refs - SolidJS · Reactive Javascript Library
The way we do this is still by using the ref attribute. From the outside, using ref on a component works very similar...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In fact,
@unocss/preset-attributify
only extract code to generate tokens, more parsed power depends on unocss engine and base on those rules that comes from@unocss/preset-uno
.I don’t think I’m equipped to answer this question😅
I didn’t see the reply in time, one step faster than you. If I don’t solve it well, you can send a new pr