From 81c376d812c4e19b955e5ccea72daf32206d6ac5 Mon Sep 17 00:00:00 2001 From: Wahid Rizka Fathurrohman Date: Thu, 1 Oct 2026 09:58:46 +0700 Subject: [PATCH] Fix two broken mixin examples in README The icons function mixin called mixin.replaceWith() for every file, so only the first rule was inserted: replaceWith() does nothing once the node has left the tree. Insert each rule with mixin.before(). The JS version of the @mixin-content example was a syntax error, had no .isIE & selector, and was named isIe while the CSS calls isIE. Return the same rule the CSS mixin defines. --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1691b9..cdfae7b 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ require('postcss-mixins')({ prop: 'background', value: 'url(' + dir + '/' + file + ')' }) - mixin.replaceWith(rule) + mixin.before(rule) }) } } @@ -237,8 +237,12 @@ or JS mixins: ```js require('postcss-mixins')({ mixins: { - isIe: function () { - '@mixin-content': {}, + isIE: function () { + return { + '.isIE &': { + '@mixin-content': {} + } + } } } });