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

Selector as Minix: tag.class #1395

Closed
vicctor opened this issue Jul 1, 2013 · 4 comments
Closed

Selector as Minix: tag.class #1395

vicctor opened this issue Jul 1, 2013 · 4 comments

Comments

@vicctor
Copy link

vicctor commented Jul 1, 2013

I'm trying to extend my class by bootstrap class input.search-query like this:

serch-form #search-input {

.input-xxlarge();
input.search-query();
}

Bootstrap file forms.less has this rule defined as:

input.search-query {
padding-right: 14px;
padding-right: 4px \9;
padding-left: 14px;
padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */
margin-bottom: 0; // Remove the default margin on all inputs
.border-radius(15px);
}

When compiling my less scrip compiler reports a syntax erro in line input.search-query();

Suppose the problem is related to the way how the rule was declared in the forms.less file.
I can not find any approach how to include this kind of rules into my final rule.

@SomMeri
Copy link
Member

SomMeri commented Jul 1, 2013

The problem is that the input.search-query is not a class - it is selector that matches an input tag with .search-query class. Only classes and ids can be used as a mixin.

You have to use new extends feature instead. Extend inside ruleset means: take my selector and add it to the other ruleset.

For example:

input.search-query {
  padding-right: 14px;
}

#serch-form #search-input {
  &:extend(input.search-query); \\ extend the other ruleset
  other: declarations;
}

would produce this:

input.search-query,
#serch-form #search-input { \\ extended selector
  padding-right: 14px;
}
#serch-form #search-input {
  other: declarations;
}

If the above solution does not help you, you can lobby for "general purpose CSS Selector as a mixin" issue #1048 .

@vicctor
Copy link
Author

vicctor commented Jul 1, 2013

Yea! Thanks. This solves my problem. Going to check it out.

@SomMeri
Copy link
Member

SomMeri commented Jul 1, 2013

You are welcome, I'm closing this issue then.

@SomMeri SomMeri closed this as completed Jul 1, 2013
@vicctor
Copy link
Author

vicctor commented Jul 1, 2013

Thx. This works for me. I just changed the name of the issue so one who will find the same problem as me will have better chance to find the solution as well.

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

No branches or pull requests

2 participants