Switch to not(last-child) instead of owl

For Alpine.js compatibility, sad because it increases the specificity but I don't think it will actually be a problem at all in real projects.
This commit is contained in:
Adam Wathan 2020-04-16 16:05:20 -04:00
parent a6f5137a73
commit b7e0f11d5d
5 changed files with 385 additions and 385 deletions

View file

@ -8,7 +8,7 @@ export default function() {
const utilities = _.fromPairs(
_.map(_.omit(colors, 'default'), (value, modifier) => {
return [
`.${e(`divide-${modifier}`)} > * + *`,
`.${e(`divide-${modifier}`)} > :not(:last-child)`,
{
'border-color': value,
},

View file

@ -4,8 +4,8 @@ export default function() {
return function({ addUtilities, e, theme, variants }) {
const generators = [
(value, modifier) => ({
[`.${e(`divide-y${modifier}`)} > * + *`]: { 'border-top-width': `${value}` },
[`.${e(`divide-x${modifier}`)} > * + *`]: { 'border-left-width': `${value}` },
[`.${e(`divide-y${modifier}`)} > :not(:last-child)`]: { 'border-bottom-width': `${value}` },
[`.${e(`divide-x${modifier}`)} > :not(:last-child)`]: { 'border-right-width': `${value}` },
}),
]

View file

@ -4,8 +4,8 @@ export default function() {
return function({ addUtilities, e, theme, variants }) {
const generators = [
(size, modifier) => ({
[`.${e(`space-y-${modifier}`)} > * + *`]: { 'margin-top': `${size}` },
[`.${e(`space-x-${modifier}`)} > * + *`]: { 'margin-left': `${size}` },
[`.${e(`space-y-${modifier}`)} > :not(:last-child)`]: { 'margin-bottom': `${size}` },
[`.${e(`space-x-${modifier}`)} > :not(:last-child)`]: { 'margin-right': `${size}` },
}),
]