Allow for :first-child
It would be great to be able to do something like:
h2:first-child' => 'mt-0',
So that the first element on the page has no top-margin, but does elsewhere. I tried it but it doesn't seem to work.
Oh yes this would be a good feature. But it is only necessary if you use Tailwind CSS,isn't it? In plain CSS you can define it by a selector.
Would be awesome to do it in Tailwind though ;)
@michaelmannucci I think that should work fine already. I have used the pseudo classes from TailwindCSS like this.
classify.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Stylesets
|--------------------------------------------------------------------------
|
| Here you can define different style collections.
| To add a new styleset you have to add a new array like the 'blog' array.
|
*/
'default' => [
'h2' => 'font-bold text-5xl first:text-red-900 last:text-sky-600',
],
];

Or dou I understand you wish wrong?
I believe that would style the first H2 on the page, regardless if it's the first-child of the div... so if you wanted to remove top-margin for the first H2, it wouldn't work if the first element isn't an H2.
Also, your example doesn't seem to work for me... lol
Hi @michaelmannucci,
you should be able to use the first or first-of-type utility from tailwindcss to accomplish your goal.