|
| 1 | +// /** |
| 2 | +// * Copyright © Magento, Inc. All rights reserved. |
| 3 | +// * See COPYING.txt for license details. |
| 4 | +// */ |
| 5 | + |
| 6 | +// # Actions toolbar |
| 7 | +// Actions toolbar is a set of actions on a page, form and so on that includes primary and/or secondary actions. |
| 8 | +// To customize action toolbar <code>.lib-actions-toolbar()</code> mixin is used. |
| 9 | +// To implement the Actions toolbar use the following markup |
| 10 | +// |
| 11 | +// **Sample of using a button + link** |
| 12 | +// ``` html |
| 13 | +// <div class="actions-toolbar"> |
| 14 | +// <div class="primary"> |
| 15 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 16 | +// </div> |
| 17 | +// <div class="secondary"> |
| 18 | +// <a class="action back" href="#"><span>Back</span></a> |
| 19 | +// </div> |
| 20 | +// </div> |
| 21 | +// ``` |
| 22 | +// |
| 23 | +// **Sample of using a button + button** |
| 24 | +// ``` html |
| 25 | +// <div class="example-actions-toolbar-1"> |
| 26 | +// <div class="primary"> |
| 27 | +// <button type="submit" class="action submit" title="Submit"><span>Redeem Gift Card</span></button> |
| 28 | +// </div> |
| 29 | +// <div class="secondary"> |
| 30 | +// <button class="action check" type="button" value="Check status and balance"> |
| 31 | +// <span>Check status and balance</span> |
| 32 | +// </button> |
| 33 | +// </div> |
| 34 | +// </div> |
| 35 | +// ``` |
| 36 | + |
| 37 | +.actions-toolbar { |
| 38 | + .lib-actions-toolbar(); |
| 39 | +} |
| 40 | + |
| 41 | +.example-actions-toolbar-1 { |
| 42 | + .lib-actions-toolbar(); |
| 43 | +} |
| 44 | + |
| 45 | +// # Actions toolbar mixin variables |
| 46 | +// |
| 47 | +// <pre> |
| 48 | +// <table> |
| 49 | +// <tr> |
| 50 | +// <th class="vars_head">Mixin variable</th> |
| 51 | +// <th class="vars_head">Global variable</th> |
| 52 | +// <th class="vars_head">Default value</th> |
| 53 | +// <th class="vars_head">Allowed values</th> |
| 54 | +// <th class="vars_head">Comment</th> |
| 55 | +// </tr> |
| 56 | +// <tr> |
| 57 | +// <th>@_actions-toolbar-actions-position</th> |
| 58 | +// <td>@actions-toolbar-actions__position</td> |
| 59 | +// <td class="vars_value">justify</td> |
| 60 | +// <td class="vars_value">justify | left | right | center</td> |
| 61 | +// <td>Position for actions in Actions toolbar</td> |
| 62 | +// </tr> |
| 63 | +// <tr> |
| 64 | +// <th>@_actions-toolbar-actions-reverse</th> |
| 65 | +// <td>@actions-toolbar-actions__reverse</td> |
| 66 | +// <td class="vars_value">false</td> |
| 67 | +// <td class="vars_value">true | false</td> |
| 68 | +// <td>Reverse primary and secondary blocks position in Actions toolbar</td> |
| 69 | +// </tr> |
| 70 | +// <tr> |
| 71 | +// <th>@_actions-toolbar-margin</th> |
| 72 | +// <td>@actions-toolbar__margin</td> |
| 73 | +// <td class="vars_value">false</td> |
| 74 | +// <td class="vars_value">'' | false | value</td> |
| 75 | +// <td>Margins of the Actions toolbar</td> |
| 76 | +// </tr> |
| 77 | +// <tr> |
| 78 | +// <th>@_actions-toolbar-padding</th> |
| 79 | +// <td>@actions-toolbar__padding</td> |
| 80 | +// <td class="vars_value">false</td> |
| 81 | +// <td class="vars_value">'' | false | value</td> |
| 82 | +// <td>Paddings of the Actions toolbar</td> |
| 83 | +// </tr> |
| 84 | +// <tr> |
| 85 | +// <th>@_actions-toolbar-actions-margin</th> |
| 86 | +// <td>@actions-toolbar-actions__margin</td> |
| 87 | +// <td class="vars_value">false</td> |
| 88 | +// <td class="vars_value">'' | false | value</td> |
| 89 | +// <td>Margins of all .actions in the Actions toolbar</td> |
| 90 | +// </tr> |
| 91 | +// <tr> |
| 92 | +// <th>@_actions-toolbar-primary-actions-margin</th> |
| 93 | +// <td>@actions-toolbar-actions-primary__margin</td> |
| 94 | +// <td class="vars_value">0 @indent__xs 0 0</td> |
| 95 | +// <td class="vars_value">'' | false | value</td> |
| 96 | +// <td>Margins of primary .actions in the Actions toolbar</td> |
| 97 | +// </tr> |
| 98 | +// <tr> |
| 99 | +// <th>@_actions-toolbar-secondary-actions-margin</th> |
| 100 | +// <td>@actions-toolbar-actions-secondary__margin</td> |
| 101 | +// <td class="vars_value">false</td> |
| 102 | +// <td class="vars_value">'' | false | value</td> |
| 103 | +// <td>Margins of secondary .actions in the Actions toolbar</td> |
| 104 | +// </tr> |
| 105 | +// <tr> |
| 106 | +// <th nowrap="nowrap">@_actions-toolbar-actions-links-margin-top</th> |
| 107 | +// <td>@actions-toolbar-actions-links__margin-top</td> |
| 108 | +// <td class="vars_value">false</td> |
| 109 | +// <td class="vars_value">'' | false | value</td> |
| 110 | +// <td>Margin-top for links with class .action in the Actions toolbar</td> |
| 111 | +// </tr> |
| 112 | +// <tr> |
| 113 | +// <th nowrap="nowrap">@_actions-toolbar-primary-actions-links-margin-top</th> |
| 114 | +// <td>@actions-toolbar-actions-links-primary__margin-top</td> |
| 115 | +// <td class="vars_value">false</td> |
| 116 | +// <td class="vars_value">'' | false | value</td> |
| 117 | +// <td>Margin-top for primary links with class .action in the Actions toolbar</td> |
| 118 | +// </tr> |
| 119 | +// <tr> |
| 120 | +// <th nowrap="nowrap">@_actions-toolbar-secondary-actions-links-margin-top</th> |
| 121 | +// <td>@actions-toolbar-actions-secondary__margin</td> |
| 122 | +// <td class="vars_value">6px</td> |
| 123 | +// <td class="vars_value">'' | false | value</td> |
| 124 | +// <td>Margin-top for secondary links with class .action in the Actions toolbar</td> |
| 125 | +// </tr> |
| 126 | +// </table> |
| 127 | +// </pre> |
| 128 | +// |
| 129 | +// # Actions toolbar alignment |
| 130 | +// |
| 131 | +// <code>@_actions-toolbar-actions-position</code> variable controls aligning actions toolbar elements. It can be set to: |
| 132 | +// ```css |
| 133 | +// justify | left | right | center |
| 134 | +// ``` |
| 135 | +// |
| 136 | +// **Justify:** |
| 137 | +// ```css |
| 138 | +// @_actions-toolbar-actions-position: justify |
| 139 | +// ``` |
| 140 | +// ``` html |
| 141 | +// <div class="example-actions-toolbar-2"> |
| 142 | +// <div class="primary"> |
| 143 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 144 | +// </div> |
| 145 | +// <div class="secondary"> |
| 146 | +// <a class="action back" href="#"><span>Back</span></a> |
| 147 | +// </div> |
| 148 | +// </div> |
| 149 | +// ``` |
| 150 | +// |
| 151 | +// **Align toolbar elements left:** |
| 152 | +// ```css |
| 153 | +// @_actions-toolbar-actions-position: left |
| 154 | +// ``` |
| 155 | +// ``` html |
| 156 | +// <div class="example-actions-toolbar-3"> |
| 157 | +// <div class="primary"> |
| 158 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 159 | +// </div> |
| 160 | +// <div class="secondary"> |
| 161 | +// <a class="action back" href="#"><span>Back</span></a> |
| 162 | +// </div> |
| 163 | +// </div> |
| 164 | +// ``` |
| 165 | +// |
| 166 | +// **Align toolbar elements right:** |
| 167 | +// ```css |
| 168 | +// @_actions-toolbar-actions-position: right |
| 169 | +// ``` |
| 170 | +// ``` html |
| 171 | +// <div class="example-actions-toolbar-4"> |
| 172 | +// <div class="primary"> |
| 173 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 174 | +// </div> |
| 175 | +// <div class="secondary"> |
| 176 | +// <a class="action back" href="#"><span>Back</span></a> |
| 177 | +// </div> |
| 178 | +// </div> |
| 179 | +// ``` |
| 180 | +// |
| 181 | +// **Center:** |
| 182 | +// ```css |
| 183 | +// @_actions-toolbar-actions-position: center |
| 184 | +// ``` |
| 185 | +// ``` html |
| 186 | +// <div class="example-actions-toolbar-5"> |
| 187 | +// <div class="primary"> |
| 188 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 189 | +// </div> |
| 190 | +// <div class="secondary"> |
| 191 | +// <a class="action back" href="#"><span>Back</span></a> |
| 192 | +// </div> |
| 193 | +// </div> |
| 194 | +// ``` |
| 195 | + |
| 196 | +.example-actions-toolbar-2 { |
| 197 | + .lib-actions-toolbar( |
| 198 | + @_actions-toolbar-actions-position: justify |
| 199 | + ); |
| 200 | +} |
| 201 | + |
| 202 | +.example-actions-toolbar-3 { |
| 203 | + .lib-actions-toolbar( |
| 204 | + @_actions-toolbar-actions-position: left |
| 205 | + ); |
| 206 | +} |
| 207 | + |
| 208 | +.example-actions-toolbar-4 { |
| 209 | + .lib-actions-toolbar( |
| 210 | + @_actions-toolbar-actions-position: right |
| 211 | + ); |
| 212 | +} |
| 213 | + |
| 214 | +.example-actions-toolbar-5 { |
| 215 | + .lib-actions-toolbar( |
| 216 | + @_actions-toolbar-actions-position: center |
| 217 | + ); |
| 218 | +} |
| 219 | + |
| 220 | +// # Reverse primary and secondary blocks |
| 221 | +// |
| 222 | +// <code>@_actions-toolbar-actions-reverse</code> variable controls reversing of primary and secondary blocks. |
| 223 | +// |
| 224 | +// If it is set to <code>false</code>, the order of blocks in action toolbar is **default**. |
| 225 | +// |
| 226 | +// If it is set to <code>true</code>, the order of blocks in action toolbar is **reversed**. |
| 227 | +// |
| 228 | +// **Justify toolbar elements and reverse them:** |
| 229 | +// ```css |
| 230 | +// @_actions-toolbar-actions-position: justify, |
| 231 | +// @_actions-toolbar-actions-reverse: true |
| 232 | +// ``` |
| 233 | +// ``` html |
| 234 | +// <div class="example-actions-toolbar-6"> |
| 235 | +// <div class="primary"> |
| 236 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 237 | +// </div> |
| 238 | +// <div class="secondary"> |
| 239 | +// <a class="action back" href="#"><span>Back</span></a> |
| 240 | +// </div> |
| 241 | +// </div> |
| 242 | +// ``` |
| 243 | +// |
| 244 | +// **Align toolbar elements to the left and reverse them:** |
| 245 | +// ```css |
| 246 | +// @_actions-toolbar-actions-position: left, |
| 247 | +// @_actions-toolbar-actions-reverse: true |
| 248 | +// ``` |
| 249 | +// ``` html |
| 250 | +// <div class="example-actions-toolbar-7"> |
| 251 | +// <div class="primary"> |
| 252 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 253 | +// </div> |
| 254 | +// <div class="secondary"> |
| 255 | +// <a class="action back" href="#"><span>Back</span></a> |
| 256 | +// </div> |
| 257 | +// </div> |
| 258 | +// ``` |
| 259 | +// |
| 260 | +// **Align toolbar elements to the right and reverse them:** |
| 261 | +// ```css |
| 262 | +// @_actions-toolbar-actions-position: right, |
| 263 | +// @_actions-toolbar-actions-reverse: true |
| 264 | +// ``` |
| 265 | +// ``` html |
| 266 | +// <div class="example-actions-toolbar-8"> |
| 267 | +// <div class="primary"> |
| 268 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 269 | +// </div> |
| 270 | +// <div class="secondary"> |
| 271 | +// <a class="action back" href="#"><span>Back</span></a> |
| 272 | +// </div> |
| 273 | +// </div> |
| 274 | +// ``` |
| 275 | + |
| 276 | +.example-actions-toolbar-6 { |
| 277 | + .lib-actions-toolbar( |
| 278 | + @_actions-toolbar-actions-position: justify, |
| 279 | + @_actions-toolbar-actions-reverse: true |
| 280 | + ); |
| 281 | +} |
| 282 | + |
| 283 | +.example-actions-toolbar-7 { |
| 284 | + .lib-actions-toolbar( |
| 285 | + @_actions-toolbar-actions-position: left, |
| 286 | + @_actions-toolbar-actions-reverse: true |
| 287 | + ); |
| 288 | +} |
| 289 | + |
| 290 | +.example-actions-toolbar-8 { |
| 291 | + .lib-actions-toolbar( |
| 292 | + @_actions-toolbar-actions-position: right, |
| 293 | + @_actions-toolbar-actions-reverse: true |
| 294 | + ); |
| 295 | +} |
| 296 | + |
| 297 | +// # Actions toolbar indents customizations |
| 298 | +// |
| 299 | +// <code>@_actions-toolbar-margin</code> variable controls margins of the actions toolbar wrapper. |
| 300 | +// |
| 301 | +// <code>@_actions-toolbar-padding</code> variable controls paddings of the actions toolbar wrapper. |
| 302 | +// |
| 303 | +// ``` html |
| 304 | +// <div class="example-actions-toolbar-9"> |
| 305 | +// <div class="primary"> |
| 306 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 307 | +// </div> |
| 308 | +// <div class="secondary"> |
| 309 | +// <a class="action back" href="#"><span>Back</span></a> |
| 310 | +// </div> |
| 311 | +// </div> |
| 312 | +// ``` |
| 313 | +// |
| 314 | +// <code>@_actions-toolbar-primary-actions-margin</code> variable controls margins of the primary action elements. |
| 315 | +// |
| 316 | +// ``` html |
| 317 | +// <div class=" example-actions-toolbar-10"> |
| 318 | +// <div class="primary"> |
| 319 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 320 | +// <button type="submit" class="action submit2" title="Submit2"><span>Submit2</span></button> |
| 321 | +// </div> |
| 322 | +// <div class="secondary"> |
| 323 | +// <a href="#" class="action towishlist"><span>Add to Wish List</span></a> |
| 324 | +// <a href="#" class="action tocompare"><span>Add to Compare</span></a> |
| 325 | +// </div> |
| 326 | +// </div> |
| 327 | +// ``` |
| 328 | +// |
| 329 | +// <code>@_actions-toolbar-secondary-actions-margin</code> variable controls margins of the secondary action elements. |
| 330 | +// |
| 331 | +// ``` html |
| 332 | +// <div class="example-actions-toolbar-11"> |
| 333 | +// <div class="primary"> |
| 334 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 335 | +// <button type="submit" class="action submit2" title="Submit2"><span>Submit2</span></button> |
| 336 | +// </div> |
| 337 | +// <div class="secondary"> |
| 338 | +// <a href="#" class="action towishlist"><span>Add to Wish List</span></a> |
| 339 | +// <a href="#" class="action tocompare"><span>Add to Compare</span></a> |
| 340 | +// </div> |
| 341 | +// </div> |
| 342 | +// ``` |
| 343 | + |
| 344 | +.example-actions-toolbar-9 { |
| 345 | + .lib-actions-toolbar( |
| 346 | + @_actions-toolbar-margin: 10px, |
| 347 | + @_actions-toolbar-padding: 10px |
| 348 | + ); |
| 349 | +} |
| 350 | + |
| 351 | +.example-actions-toolbar-10 { |
| 352 | + .lib-actions-toolbar( |
| 353 | + @_actions-toolbar-actions-position: left, |
| 354 | + @_actions-toolbar-primary-actions-margin: 0 50px 0 0 |
| 355 | + ); |
| 356 | +} |
| 357 | + |
| 358 | +.example-actions-toolbar-11 { |
| 359 | + .lib-actions-toolbar( |
| 360 | + @_actions-toolbar-actions-position: left, |
| 361 | + @_actions-toolbar-secondary-actions-margin: 0 50px 0 0 |
| 362 | + ); |
| 363 | +} |
| 364 | + |
| 365 | +// # Responsive actions toolbar |
| 366 | +// |
| 367 | +// To set up responsive action toolbar, all floats of its elements should be cleared. To do this <code>.lib-actions-toolbar-clear-floats()</code> mixin is used. |
| 368 | +// |
| 369 | +// ``` html |
| 370 | +// <div class="example-actions-toolbar-12"> |
| 371 | +// <div class="primary"> |
| 372 | +// <button type="submit" class="action submit" title="Submit"><span>Submit</span></button> |
| 373 | +// </div> |
| 374 | +// <div class="secondary"> |
| 375 | +// <a href="#" class="action towishlist"><span>Add to Wish List</span></a> |
| 376 | +// </div> |
| 377 | +// </div> |
| 378 | +// ``` |
| 379 | + |
| 380 | +.example-actions-toolbar-12 { |
| 381 | + .lib-actions-toolbar(); |
| 382 | +} |
| 383 | + |
| 384 | +@media only screen and (max-width: @screen__m) { |
| 385 | + .example-actions-toolbar-12 { |
| 386 | + .lib-actions-toolbar-clear-floats(); |
| 387 | + } |
| 388 | +} |
0 commit comments