Angular scopes
I've encountered a small bug while using Angular & Semantic UI together.
The problem appears when using angular directives with html elements that depend on their parent class. The directives break the CSS selectors and styles are not inherited.
Here is an example:
<div class="ui four doubling cards" >
<div class="ui card"> ... </div>
<div ng-repeat="element in collection">
<div class="ui card">...</div>
</div>
</div>
The first card acquires the @groupCardMargin whereas the second card contained in the ng-repeat does not, and assigning a "ui cards" class to the ng-repeat breaks the auto-sizing for counted cards.
I'm not sure I can provide angular specific help without being able to inspect the generated html.
You might want to ask in semantic-ui-angular, or our in one of our two respective chat rooms
Btw, I went to McGill. Glad they have a hack program now :+1:
Haha 2 years strong :rocket: our 3rd hackathon will happen this Feb!
The generated html for my example above is just:
<div class="ui four doubling cards" >
<div class="ui card"> ... </div>
<div ng-repeat="element in collection" class="ng-scope">
<div class="ui card">...</div>
</div>
</div>
So the problem happens because the ng-repeated "ui card" elements are >1 level nested in the "ui four doubling cards" div. I'm not sure what effect disregarding the nesting level on "ui card" styles would have on the framework - it might only be solvable on a case-by-case basis :confused:
Yes, in general, SUI markup will have specific requirements for parent/child relationship with css. Generally arbitrary intermediate selectors will not work correctly.
Generally this helps distinguish parts of an element that may exist in multiple UI, i.e. dropdown > menu > item vs ui list > .item vs ui menu > .item, ui.menu > .menu > .item.
With cards it may not necessarily be as important, but it does prevent issues with nested cards, and helps match the rest of the library's specificity.