Override a mixin?

2,933 views
Skip to first unread message

gmclelland

unread,
Oct 26, 2012, 6:27:46 PM10/26/12
to compas...@googlegroups.com
Is it possible to override a mixin by copying and pasting and modifying it into your .scss file?

For instance, say I want to experiment with a different text-replacement technique for the compass hide-text mixin using this technique http://nicolasgallagher.com/another-css-image-replacement-technique/

For some reason IE9 the text still shows with the built in compass method.

Thanks for any help anyone can provide

Micah Godbolt

unread,
Oct 26, 2012, 6:31:37 PM10/26/12
to compas...@googlegroups.com
You could just create the mixin with a different name, and do a search and replace to update the name.

Or else you could not load the compass IR by only loading the pieces you need.

John Albin Wilkins

unread,
Oct 27, 2012, 1:05:26 AM10/27/12
to compas...@googlegroups.com
Hi Glenn,

Yeah, I've done that before. You can redefine mixins. A mixin that gets loaded last will override a mixin with the same name that was loaded earlier. So you just need to get your @import statements in the right order.

I've done this:

@import "compass";
@import "custom"; // Project-specific mixins + overrides

Though, if you've found a legitimate bug in a Compass mixin, PLEASE file a bug report explaining the problem and how you fixed it. :-)

 - John

--
You received this message because you are subscribed to the Google Groups "Compass" group.
To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/JaMzVk7PzkoJ.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.

gmclelland

unread,
Oct 27, 2012, 11:42:51 PM10/27/12
to compas...@googlegroups.com
Thanks Micah and John.  I will give that a shot.
Reply all
Reply to author
Forward
0 new messages