summaryrefslogtreecommitdiffstats
path: root/jquery/sass/_round-corners-last-item.scss
blob: 70a8391282b8e10fe2b0d96b20d2db1ca3468b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Generate rules to round the corners of the last collapsible item

@mixin sm-dox__round-corners-last-item($amount, $chainable: 'ul > li:last-child > ', $level: 4, $chain_prefix: '> li:last-child > ', $chain: '', $selector: '') {
	$chain: $chain_prefix;
	$selector: $chain + 'a, ' + $chain + '*:not(ul) a, ' + $chain + 'ul';
	@for $i from 1 through $level {
		$chain: $chain + $chainable;
		$selector: $selector + ', ' + $chain + ' a, ' + $chain + '*:not(ul) a, ' + $chain + ' ul';
	}
	#{$selector} {
		@include border-radius(0 0 $amount $amount);
	}
	// highlighted items, don't need rounding since their sub is open
	$chain: $chain_prefix;
	$selector: $chain + 'a.highlighted, ' + $chain + '*:not(ul) a.highlighted';
	@for $i from 1 through $level {
		$chain: $chain + $chainable;
		$selector: $selector + ', ' + $chain + ' a.highlighted, ' + $chain + '*:not(ul) a.highlighted';
	}
	#{$selector} {
		@include border-radius(0);
	}
}