File: nesting.less

package info (click to toggle)
python-lesscpy 0.13.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,436 kB
  • sloc: python: 3,572; sh: 20; makefile: 8
file content (130 lines) | stat: -rw-r--r-- 1,852 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
	Simple nesting
*/
.div {
	color: blue;
	.nest {
		&.deep {
			color: yellow;
			.deeper {
				color: angry;
				.deepest {
					color: purple;
					.hidden {}
				}
			}
		}
		color: red;
	}
}
/*
	& combinator and placements
*/
h1, h2, h3 {
	a, p {
    	&:hover {
      		color: red;
    	}
  	}
}
a {
    &.btn {
        &-small {
            span {
                font-size: 10px;
            }
        }
    }
}
a {
  	color: red;
  	&:hover { color: blue; }
  	div & { color: green; }
  	p & span { color: yellow; }
}
.foo {
	.bar, .baz {
	    & .qux {
	      	display: block;
	    }
	    .qux & {
	      	display: inline;
	    }
	    .qux & .biz {
	      	display: none;
	    }
  	}
}
/*
	@_o
*/
#first > .one {
	> #second .two > #deux {
    	width: 50%;
    	#third {
      		&:focus {
        		color: black;
        		#fifth {
          			> #sixth {
            			.seventh #eighth {
                			color: purple;
                			+ .sibling_selector {
                				color: angry;
                			}
            			}
          			}
          			&:hover {
          				// empty
          			}
        		}
      		}
      		~ p.general_sibling_selector {
      			color: unused;
      		}
      		height: 100%;
    	}
    	#fourth, #five, #six {
      		color: #110000;
      		.seven, .eight > #nine {
        		border: 1px solid black;
      		}
      		#ten {
        		color: red;
      		}
    	}
  	}
  	font-size: 2em;
}
/*
	Multiples
	expands to 160 identifiers
*/
h1, h2, h3, h4, h5 {
	a, p, div, span {	
		.one, .two, .three, .four {
			&:hover, &:focus {	
				display: block;
			}
		}
	}
}
.child, .sibling {
  & + & {
    color: red;
  }
}
.child, .sibling {
  & + & + & {
    color: red;
  }
}
.child, .sibling, .foo {
  & + & + & {
    color: red;
  }
}
.child, .sibling, .foo {
  & + & {
    color: red;
  }
}