|
2 | 2 | // Globals
|
3 | 3 | // --------------------------------------------------
|
4 | 4 | @import "../../themes/ionic.globals";
|
| 5 | +@import "../../themes/ionic.mixins"; |
5 | 6 |
|
6 | 7 |
|
7 | 8 | // Normalize
|
@@ -49,6 +50,36 @@ $h5-font-size: 1.8rem !default;
|
49 | 50 | $h6-font-size: 1.6rem !default;
|
50 | 51 |
|
51 | 52 |
|
| 53 | +// Responsive Utilities |
| 54 | +// -------------------------------------------------- |
| 55 | + |
| 56 | +/// @prop - Whether to include all of the responsive utility attributes |
| 57 | +$include-responsive-utilities: true !default; |
| 58 | + |
| 59 | +/// @prop - Whether to include all of the responsive text alignment attributes |
| 60 | +$include-text-alignment-utilities: $include-responsive-utilities !default; |
| 61 | + |
| 62 | +/// @prop - Whether to include all of the responsive text transform attributes |
| 63 | +$include-text-transform-utilities: $include-responsive-utilities !default; |
| 64 | + |
| 65 | +/// @prop - Whether to include all of the responsive float attributes |
| 66 | +$include-float-element-utilities: $include-responsive-utilities !default; |
| 67 | + |
| 68 | + |
| 69 | +// Screen Breakpoints |
| 70 | +// -------------------------------------------------- |
| 71 | + |
| 72 | +/// @prop - The minimum dimensions at which your layout will change, |
| 73 | +/// adapting to different screen sizes, for use in media queries |
| 74 | +$screen-breakpoints: ( |
| 75 | + xs: 0, |
| 76 | + sm: 576px, |
| 77 | + md: 768px, |
| 78 | + lg: 992px, |
| 79 | + xl: 1200px |
| 80 | +) !default; |
| 81 | + |
| 82 | + |
52 | 83 | // App Structure
|
53 | 84 | // --------------------------------------------------
|
54 | 85 |
|
@@ -293,77 +324,128 @@ ion-footer {
|
293 | 324 | // Text Alignment
|
294 | 325 | // --------------------------------------------------
|
295 | 326 |
|
296 |
| -[text-left] { |
297 |
| - text-align: left; |
298 |
| -} |
299 |
| - |
300 |
| -[text-center] { |
301 |
| - text-align: center; |
302 |
| -} |
303 |
| - |
304 |
| -[text-right] { |
305 |
| - text-align: right; |
306 |
| -} |
307 |
| - |
308 |
| -[text-start] { |
309 |
| - text-align: start; |
310 |
| -} |
311 |
| - |
312 |
| -[text-end] { |
313 |
| - text-align: end; |
314 |
| -} |
315 |
| - |
316 |
| -[text-justify] { |
317 |
| - text-align: justify; |
318 |
| -} |
319 |
| - |
320 |
| -[text-nowrap] { |
321 |
| - white-space: nowrap; |
322 |
| -} |
323 |
| - |
324 |
| -[text-wrap] { |
325 |
| - white-space: normal; |
| 327 | +@if ($include-text-alignment-utilities == true) { |
| 328 | + // Creates text alignment attributes based on screen size |
| 329 | + @each $breakpoint in map-keys($screen-breakpoints) { |
| 330 | + $infix: breakpoint-infix($breakpoint, $screen-breakpoints); |
| 331 | + |
| 332 | + @include media-breakpoint-up($breakpoint, $screen-breakpoints) { |
| 333 | + // Provide `[text-{bp}]` attributes for aligning the text based |
| 334 | + // on the breakpoint |
| 335 | + [text#{$infix}-center] { |
| 336 | + // scss-lint:disable ImportantRule |
| 337 | + text-align: center !important; |
| 338 | + } |
| 339 | + |
| 340 | + [text#{$infix}-justify] { |
| 341 | + // scss-lint:disable ImportantRule |
| 342 | + text-align: justify !important; |
| 343 | + } |
| 344 | + |
| 345 | + [text#{$infix}-start] { |
| 346 | + // scss-lint:disable ImportantRule |
| 347 | + text-align: start !important; |
| 348 | + } |
| 349 | + |
| 350 | + [text#{$infix}-end] { |
| 351 | + // scss-lint:disable ImportantRule |
| 352 | + text-align: end !important; |
| 353 | + } |
| 354 | + |
| 355 | + [text#{$infix}-left] { |
| 356 | + // scss-lint:disable ImportantRule |
| 357 | + text-align: left !important; |
| 358 | + } |
| 359 | + |
| 360 | + [text#{$infix}-right] { |
| 361 | + // scss-lint:disable ImportantRule |
| 362 | + text-align: right !important; |
| 363 | + } |
| 364 | + |
| 365 | + [text#{$infix}-nowrap] { |
| 366 | + // scss-lint:disable ImportantRule |
| 367 | + white-space: nowrap !important; |
| 368 | + } |
| 369 | + |
| 370 | + [text#{$infix}-wrap] { |
| 371 | + // scss-lint:disable ImportantRule |
| 372 | + white-space: normal !important; |
| 373 | + } |
| 374 | + } |
| 375 | + } |
326 | 376 | }
|
327 | 377 |
|
328 | 378 |
|
329 | 379 | // Text Transformation
|
330 | 380 | // --------------------------------------------------
|
331 | 381 |
|
332 |
| -[text-uppercase] { |
333 |
| - text-transform: uppercase; |
334 |
| -} |
335 |
| - |
336 |
| -[text-lowercase] { |
337 |
| - text-transform: lowercase; |
| 382 | +@if ($include-text-transform-utilities == true) { |
| 383 | + // Creates text transform attributes based on screen size |
| 384 | + @each $breakpoint in map-keys($screen-breakpoints) { |
| 385 | + $infix: breakpoint-infix($breakpoint, $screen-breakpoints); |
| 386 | + |
| 387 | + @include media-breakpoint-up($breakpoint, $screen-breakpoints) { |
| 388 | + // Provide `[text-{bp}]` attributes for transforming the text based |
| 389 | + // on the breakpoint |
| 390 | + [text#{$infix}-uppercase] { |
| 391 | + // scss-lint:disable ImportantRule |
| 392 | + text-transform: uppercase !important; |
| 393 | + } |
| 394 | + |
| 395 | + [text#{$infix}-lowercase] { |
| 396 | + // scss-lint:disable ImportantRule |
| 397 | + text-transform: lowercase !important; |
| 398 | + } |
| 399 | + |
| 400 | + [text#{$infix}-capitalize] { |
| 401 | + // scss-lint:disable ImportantRule |
| 402 | + text-transform: capitalize !important; |
| 403 | + } |
| 404 | + } |
| 405 | + } |
338 | 406 | }
|
339 | 407 |
|
340 |
| -[text-capitalize] { |
341 |
| - text-transform: capitalize; |
342 |
| -} |
343 | 408 |
|
344 |
| -// Float |
| 409 | +// Float Elements |
345 | 410 | // --------------------------------------------------
|
346 | 411 |
|
347 |
| -[pull-left] { |
348 |
| - float: left; |
349 |
| -} |
350 |
| - |
351 |
| -[pull-right] { |
352 |
| - float: right; |
353 |
| -} |
354 |
| - |
355 |
| -[pull-start] { |
356 |
| - float: left; |
357 |
| -} |
358 |
| - |
359 |
| -[pull-end] { |
360 |
| - float: right; |
361 |
| -} |
362 |
| - |
363 |
| -[dir="rtl"] [pull-start] { |
364 |
| - float: right; |
365 |
| -} |
366 |
| - |
367 |
| -[dir="rtl"] [pull-end] { |
368 |
| - float: left; |
| 412 | +@if ($include-float-element-utilities == true) { |
| 413 | + // Creates text transform attributes based on screen size |
| 414 | + @each $breakpoint in map-keys($screen-breakpoints) { |
| 415 | + $infix: breakpoint-infix($breakpoint, $screen-breakpoints); |
| 416 | + |
| 417 | + @include media-breakpoint-up($breakpoint, $screen-breakpoints) { |
| 418 | + // Provide `[pull-{bp}]` attributes for floating the element based |
| 419 | + // on the breakpoint |
| 420 | + [pull#{$infix}-left] { |
| 421 | + // scss-lint:disable ImportantRule |
| 422 | + float: left !important; |
| 423 | + } |
| 424 | + |
| 425 | + [pull#{$infix}-right] { |
| 426 | + // scss-lint:disable ImportantRule |
| 427 | + float: right !important; |
| 428 | + } |
| 429 | + |
| 430 | + [pull#{$infix}-start] { |
| 431 | + // scss-lint:disable ImportantRule |
| 432 | + float: left !important; |
| 433 | + } |
| 434 | + |
| 435 | + [pull#{$infix}-end] { |
| 436 | + // scss-lint:disable ImportantRule |
| 437 | + float: right !important; |
| 438 | + } |
| 439 | + |
| 440 | + [dir="rtl"] [pull#{$infix}-start] { |
| 441 | + // scss-lint:disable ImportantRule |
| 442 | + float: right !important; |
| 443 | + } |
| 444 | + |
| 445 | + [dir="rtl"] [pull#{$infix}-end] { |
| 446 | + // scss-lint:disable ImportantRule |
| 447 | + float: left !important; |
| 448 | + } |
| 449 | + } |
| 450 | + } |
369 | 451 | }
|
0 commit comments