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

Some rules are not built as expected. #86

Open
jacksky007 opened this issue Dec 30, 2013 · 2 comments
Open

Some rules are not built as expected. #86

jacksky007 opened this issue Dec 30, 2013 · 2 comments
Assignees
Labels

Comments

@jacksky007
Copy link

All rules should be under class '.gud', but something wrong happen.
For example, what we expect

.gud select.form-control

is currently

select.gud .form-control

I've found a solution, and will fix this when I have enough time.

@ghost ghost assigned jacksky007 Dec 30, 2013
@mikaelkaron
Copy link

Awesome. Can you add an explanation of what went wrong in the ticket?

On 30 Dec, 2013, at 5:06, Jack [email protected] wrote:

All rules should be under class '.gud', but something wrong happen.
For example, what we expect

.gud select.form-control
is currently

select.gud .form-control
I've found a solution, and will fix this when I have enough time.


Reply to this email directly or view it on GitHub.

@jacksky007
Copy link
Author

In forms-ef.less, we have

.form-control {
  select& {
    /* some rules */
  }
}

If we build css file directly from this less file, we will get

select.form-control {
  /* some rules */
}

The character '&' is a placeholder of outer selector.
Further more, its scope is global not just in this file.
So, in gudstrap.less, we have

.gud {
  @import "bootstrap-ef.less";
}

This equals to rules as bellow

.gud {
  .form-control {
    select& {
      /* some rules */
    }
  }
}

and will result

select.gud .form-control {
  /* some rules */
}

The solution is building bootstrap-ef.less to bootstrap-ef.css firstly.
Second, modify gudstrap.less as bellow

.gud {
  @import (inline) "bootstrap-ef.css";
}

Third, build gudstrap.less to gudstrap.less.css.
Last, treat the temp file gudstrap.less.css as less file and build it to gudstrap.css.

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

No branches or pull requests

2 participants