@@ -136,27 +136,41 @@ they are evaluated:
136
136
margin: 10px - 5px;
137
137
```
138
138
139
- Division has a special quirk. Due to CSS font shorthand syntax, we need to be
140
- careful about how we place spaces. In the following example we are using font
141
- size and lineheight shorthand. No division should take place:
139
+ Division has a special quirk. There are certain CSS properties that use the ` / `
140
+ operator as part of their value's syntax. Namely, the [ font] [ 4 ] shorthand and
141
+ [ border-radius] [ 3 ] .
142
+
143
+ [ 3 ] : https://developer.mozilla.org/en/CSS/border-radius
144
+ [ 4 ] : https://developer.mozilla.org/en/CSS/font
145
+
146
+
147
+ Thus, ** lessphp** will ignore any division in these properties unless it is
148
+ wrapped in parentheses. For example, no division will take place here:
142
149
143
150
```less
144
151
.font {
145
152
font: 20px/80px "Times New Roman";
146
153
}
147
154
```
148
155
149
- In order to force division we can surround the ` / ` by spaces, or we can wrap
150
- the expression in parentheses:
156
+ In order to force division we must wrap the expression in parentheses:
151
157
152
158
```less
153
159
.font {
154
- // these two will evaluate
155
- font: 20px / 80px "Times New Roman";
156
160
font: (20px/80px) "Times New Roman";
157
161
}
158
162
```
159
163
164
+ If you want to write a literal ` / ` expression without dividing in another
165
+ property (or a variable), you can use [ string unquoting] ( #string_unquoting ) :
166
+
167
+ ```less
168
+ .var {
169
+ @size: ~"20px/80px"
170
+ font: @size sans-serif;
171
+ }
172
+ ```
173
+
160
174
### Nested Blocks
161
175
162
176
By nesting blocks we can build up a chain of CSS selectors through scope
0 commit comments