You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not quite sure how viable these ideas are, or whether they conflict with the core principles of Mist. But they are certainly how I intuitively want to use the tool. I haven't had much time to work on a PR yet.
The first tag[data-...] needs to be the component "name" then other [data-...] should be "props".
In this regard, you need to structure your CSS just like you would your React components which is familiar to devs but could be made more DRY in CSS.
This is a convention that has pros and cons. I'd like to keep it for the moment as it may be useful to have one to make it easier to build other features on top of it (goto definition for example #73).
If it's applied to all tags then, for example, <hr /> would get data-card-variant="primary" autocomplete in the code editor, which I'm unsure would be useful?
That said I'm always curious about better understanding how MistCSS is used and if there are things that could be improved.
I think <hr /> is an example of where it wouldn't make sense, but if you consider something like a callout element might be a div, section, blockquote or aside.
Activity
juice49 commentedon Dec 12, 2024
I ran into the same issue, and considered trying to add the following:
:is).[data-card-variant="primary"]) by augmenting the type of all elements. Something like this:Input CSS
Output TypeScript
Not quite sure how viable these ideas are, or whether they conflict with the core principles of Mist. But they are certainly how I intuitively want to use the tool. I haven't had much time to work on a PR yet.
typicode commentedon Dec 14, 2024
Hey,
First of all, thanks a lot for the review and this feedback. I must admit I've not considered doing it this way.
Basically, I considered how visual components are written and translated it to CSS (simplified example):
The first
tag[data-...]needs to be the component "name" then other[data-...]should be "props".In this regard, you need to structure your CSS just like you would your React components which is familiar to devs but could be made more DRY in CSS.
This is a convention that has pros and cons. I'd like to keep it for the moment as it may be useful to have one to make it easier to build other features on top of it (goto definition for example #73).
I'm not sure to understand this use case:
If it's applied to all tags then, for example,
<hr />would getdata-card-variant="primary"autocomplete in the code editor, which I'm unsure would be useful?That said I'm always curious about better understanding how MistCSS is used and if there are things that could be improved.
wesbos commentedon Dec 17, 2024
I think
<hr />is an example of where it wouldn't make sense, but if you consider something like acalloutelement might be a div, section, blockquote or aside.Or a common use case I have is heading elements:
not a huge deal, but these kinds of papercuts are what cause people to use non-semantic elements and we end up with click handlers on divs