That’s pretty much the same thing I’m doing, but you need to do that manually each time the hierarchy changed.
The Container custom control I previously posted does that automatically
That’s pretty much the same thing I’m doing, but you need to do that manually each time the hierarchy changed.
The Container custom control I previously posted does that automatically
I agree, but how would you apply your solution to an existing control, like a ListView?
Honestly surprised this still hasn’t been implemented. This is a very basic feature of css. +1 for implementing it!
Workaround for :first-child / :last-child for now is to add a name attribute to the element and then style through #name.
And I’m sitting here frustrated, why ::after behave so weirdly, when It’s being simply ignored. After so many years of promoting to switch to UITK. Workarounds on workarounds on workarounds. I’d better use UGUI and IMGUI.
yes how can you style the last item in a list view…
this lack of css selectors and features is just a hassle, gradients and last item… or even first item ie adding bottom/top borders without it doubling between rows etc, ie you just want to style the first or bottom differently.
+1!
I’m near the beginning of my Unity Dev journey and a little mystified this has been requested for so long and still not implemented. All I want to do is some stylizing of text by applying transform/rotation/size/font weight to nth-child.
The fact all the documentation is pushing me so hard towards UI Toolkit when I still cant do this basic example that is so easy to implement with the TMP+UGUI approach, is somewhat mystifying. Its even touted that UI Toolkit is aimed at Web devs, yet the OTHER option has more complete parity with CSS? It is truly trivial to do in TMP, but impossible without a custom script in UI Toollkit.
Theres a few points in the Dev Pipeline for Unity like this, where you just wonder “What even is the choice I’m about to make?”, but this one keeps smacking me in the face. For someone trying to decide which approach to study and implement, they essentially have to learn how to implement both before deciding. And even then, it seems whichever choice you make is like bargaining with a 5th-dimensional imp, what arcane rule will get me next? ![]()
There’s very little I’m willing to say authoritatively at this stage in my learning, but I think a beginner is best equipped to argue on this subject, and this feels like I’ve shown up at a uniquely bad time to be a beginner ![]()
I mean it’s been like that for years, ugui has more addons to fix the gaps that never got added like flex, new widgets ui for easy drop in components that work and active developer etc.. uitoolkit not as many addons and everything provided is either incomplete and or somewhat janky or buggy (uitoolkit debugger for one, you can’t even undo changes to values made etc) you’ll definetely have to do alot of figuring out ways of getting something done as a workaround for things that just aren’t implemented when they should be.
From what I’ve done with it (editor tool stuff mainly), its something that could be really good for games and not just editor ui’s and some find it good enough to use now. Personally I think you’re left with using something that is still far from complete and more of a hassle than ugui is. If you’re just doing basics both are fine, more so uitoolkit really now, but you start doing anything more than basics like tables datagrids and fancy stuff and an interface than isn’t just buttons slapped onto the screen well good luck neither are easy but uitoolkit is just messy and harder and things are still missing and changing on top of that. Maybe in another year or 2 it will be a no brainer to recommend and more assets to fill in the gaps will exist currently I’m on the fence and sticking with ugui for games.
Yeah its tough, i think the conclusion I’m coming to is that by the time I’m ready to develop my big dream project which is very UI heavy, UI Toolkit will likely have what i need, and i think i prefer most of its featureset, so I might as well go that direction in the mean time, it just bugs me. If they’d at least put it explicitly on the roadmap I’d be less irked.
I think most of the effort lately has been in covering the two major showstoppers for a lot of people: world space UI support, and shader support. Both of which have come out recently.
You can always keep submitting these to the roadmap to make sure the point gets through.
Unity announced that new pseudo classes are planned for 6.7 and beyond
Sad it took too much time to see those features on the roadmap…