Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mixins for stylus. Add in settings of "format_file" (remove "less") #128

Closed
wants to merge 3 commits into from

Conversation

trolev
Copy link

@trolev trolev commented Jan 30, 2014

Usage.

Configuration files:
format_file=css (example: styl, less ...)
stylus_mixins=True (%name-mixins.styl)
stylus_mixins_template

Command line arguments:
--stylus - analogously "--css"

@trolev
Copy link
Author

trolev commented Jan 31, 2014

example sprite-mixins.styl:

sprite-icon(arg = null, arg2 = null)
  importance = unquote("")
  if arg and arg2
    if arg2 == !important or arg2 == important
      importance = !important
  else if arg == !important or arg == important
      importance = !important
  if p in arg or r in arg
    background-position: 0px 0px importance
    if r in arg
      width: 2px importance
      height: 2px importance
  else
    display: inline-block importance
    background: url(../images/sprite.png) no-repeat 0px 0px importance
    width: 2px importance
    height: 2px importance

Usage

example 1:

.class
  sprite-icon()


.class {
  disaplay: inline-block;
  background: url(../images/sprite.png) no-repeat 0px 0px;
  width: 2px;
  height: 2px;
}

example 2:

.class
  sprite-icon(p)


.class {
  background-position: 0px 0px;
}

example 3:

.class
  sprite-icon(r)


.class {
  background-position: 0px 0px;
  width: 2px;
  height: 2px;
}

example 4, 5 and 6:

.class
  sprite-icon(!important)
  sprite-icon(p, !important)
  sprite-icon(r, !important)


.class {
  background-position: 0px 0px !important;
  width: 2px !important;
  height: 2px !important;
}

@jorgebastida
Copy link
Owner

Hello @trolev. As part of the migration from glue 0.4 to 0.9, we rewrote glue from scratch in order to make it support new formats quite more easily. I can't merge this Pull Request right now as the codebase is 100% different, but I would love to accept a new one based on glue 0.9.

If you need any help, please send me an email and I would try to help you in the migration. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants