@madgex/design-system 1.14.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 11 Jul 2019 12:56:59 GMT
3
+ * Generated on Thu, 11 Jul 2019 14:20:25 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -31,6 +31,7 @@
31
31
  --mds-color-text-invert: #ffffff;
32
32
  --mds-color-border: #979797;
33
33
  --mds-font-family-base: "Helvetica", Arial, sans-serif;
34
+ --mds-font-size-base: 16px;
34
35
  --mds-font-type-canon-default-size: 28px;
35
36
  --mds-font-type-canon-default-line-height: 1.15;
36
37
  --mds-font-type-canon-sm-size: 32px;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 11 Jul 2019 12:56:59 GMT
3
+ * Generated on Thu, 11 Jul 2019 14:20:25 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -534,6 +534,25 @@ module.exports = {
534
534
  ]
535
535
  }
536
536
  },
537
+ "size": {
538
+ "base": {
539
+ "value": "16px",
540
+ "original": {
541
+ "value": "16px"
542
+ },
543
+ "name": "MdsFontSizeBase",
544
+ "attributes": {
545
+ "category": "font",
546
+ "type": "size",
547
+ "item": "base"
548
+ },
549
+ "path": [
550
+ "font",
551
+ "size",
552
+ "base"
553
+ ]
554
+ }
555
+ },
537
556
  "type": {
538
557
  "canon": {
539
558
  "default": {
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  Do not edit directly
4
- Generated on Thu, 11 Jul 2019 12:56:59 GMT
4
+ Generated on Thu, 11 Jul 2019 14:20:25 GMT
5
5
  */
6
6
 
7
7
  $mds-color-brand-1-base: #1b75bb !default;
@@ -31,6 +31,7 @@ $mds-color-text-base: #222222 !default;
31
31
  $mds-color-text-invert: #ffffff !default;
32
32
  $mds-color-border: #979797 !default;
33
33
  $mds-font-family-base: "Helvetica", Arial, sans-serif !default;
34
+ $mds-font-size-base: 16px !default;
34
35
  $mds-font-type-canon-default-size: 28px !default;
35
36
  $mds-font-type-canon-default-line-height: 1.15 !default;
36
37
  $mds-font-type-canon-sm-size: 32px !default;
@@ -174,6 +175,9 @@ $tokens: (
174
175
  'family': (
175
176
  'base': $mds-font-family-base
176
177
  ),
178
+ 'size': (
179
+ 'base': $mds-font-size-base
180
+ ),
177
181
  'type': (
178
182
  'canon': (
179
183
  'default': (
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Do not edit directly
3
- Generated on Thu, 11 Jul 2019 12:56:59 GMT
3
+ Generated on Thu, 11 Jul 2019 14:20:25 GMT
4
4
  */
5
5
  html,
6
6
  body,
@@ -430,261 +430,261 @@ template {
430
430
  }
431
431
 
432
432
  .mds-font-canon, h1 {
433
- font-size: 28px;
433
+ font-size: 1.75rem;
434
434
  line-height: 1.15;
435
435
  }
436
436
 
437
437
  @media (min-width: 25em) {
438
438
  .mds-font-canon, h1 {
439
- font-size: 32px;
439
+ font-size: 2rem;
440
440
  line-height: 1.13;
441
441
  }
442
442
  }
443
443
 
444
444
  @media (min-width: 37.5em) {
445
445
  .mds-font-canon, h1 {
446
- font-size: 52px;
446
+ font-size: 3.25rem;
447
447
  line-height: 1.08;
448
448
  }
449
449
  }
450
450
 
451
451
  @media (min-width: 63em) {
452
452
  .mds-font-canon, h1 {
453
- font-size: 44px;
453
+ font-size: 2.75rem;
454
454
  line-height: 1.1;
455
455
  }
456
456
  }
457
457
 
458
458
  .mds-font-trafalgar, h2 {
459
- font-size: 20px;
459
+ font-size: 1.25rem;
460
460
  line-height: 1.2;
461
461
  }
462
462
 
463
463
  @media (min-width: 25em) {
464
464
  .mds-font-trafalgar, h2 {
465
- font-size: 24px;
465
+ font-size: 1.5rem;
466
466
  line-height: 1.17;
467
467
  }
468
468
  }
469
469
 
470
470
  @media (min-width: 37.5em) {
471
471
  .mds-font-trafalgar, h2 {
472
- font-size: 36px;
472
+ font-size: 2.25rem;
473
473
  line-height: 1.12;
474
474
  }
475
475
  }
476
476
 
477
477
  @media (min-width: 63em) {
478
478
  .mds-font-trafalgar, h2 {
479
- font-size: 32px;
479
+ font-size: 2rem;
480
480
  line-height: 1.13;
481
481
  }
482
482
  }
483
483
 
484
484
  .mds-font-paragon, h3 {
485
- font-size: 20px;
485
+ font-size: 1.25rem;
486
486
  line-height: 1.2;
487
487
  }
488
488
 
489
489
  @media (min-width: 25em) {
490
490
  .mds-font-paragon, h3 {
491
- font-size: 22px;
491
+ font-size: 1.375rem;
492
492
  line-height: 1.19;
493
493
  }
494
494
  }
495
495
 
496
496
  @media (min-width: 37.5em) {
497
497
  .mds-font-paragon, h3 {
498
- font-size: 28px;
498
+ font-size: 1.75rem;
499
499
  line-height: 1.15;
500
500
  }
501
501
  }
502
502
 
503
503
  @media (min-width: 63em) {
504
504
  .mds-font-paragon, h3 {
505
- font-size: 28px;
505
+ font-size: 1.75rem;
506
506
  line-height: 1.15;
507
507
  }
508
508
  }
509
509
 
510
510
  .mds-font-double-pica, h4 {
511
- font-size: 20px;
511
+ font-size: 1.25rem;
512
512
  line-height: 1.2;
513
513
  }
514
514
 
515
515
  @media (min-width: 25em) {
516
516
  .mds-font-double-pica, h4 {
517
- font-size: 20px;
517
+ font-size: 1.25rem;
518
518
  line-height: 1.2;
519
519
  }
520
520
  }
521
521
 
522
522
  @media (min-width: 37.5em) {
523
523
  .mds-font-double-pica, h4 {
524
- font-size: 26px;
524
+ font-size: 1.625rem;
525
525
  line-height: 1.16;
526
526
  }
527
527
  }
528
528
 
529
529
  @media (min-width: 63em) {
530
530
  .mds-font-double-pica, h4 {
531
- font-size: 24px;
531
+ font-size: 1.5rem;
532
532
  line-height: 1.17;
533
533
  }
534
534
  }
535
535
 
536
536
  .mds-font-great-primer, .js .mds-tabs__list-item {
537
- font-size: 18px;
537
+ font-size: 1.125rem;
538
538
  line-height: 1.23;
539
539
  }
540
540
 
541
541
  @media (min-width: 25em) {
542
542
  .mds-font-great-primer, .js .mds-tabs__list-item {
543
- font-size: 18px;
543
+ font-size: 1.125rem;
544
544
  line-height: 1.23;
545
545
  }
546
546
  }
547
547
 
548
548
  @media (min-width: 37.5em) {
549
549
  .mds-font-great-primer, .js .mds-tabs__list-item {
550
- font-size: 21px;
550
+ font-size: 1.3125rem;
551
551
  line-height: 1.15;
552
552
  }
553
553
  }
554
554
 
555
555
  @media (min-width: 63em) {
556
556
  .mds-font-great-primer, .js .mds-tabs__list-item {
557
- font-size: 20px;
557
+ font-size: 1.25rem;
558
558
  line-height: 1.2;
559
559
  }
560
560
  }
561
561
 
562
562
  .mds-font-body-copy, body {
563
- font-size: 14px;
563
+ font-size: 0.875rem;
564
564
  line-height: 1.43;
565
565
  }
566
566
 
567
567
  @media (min-width: 25em) {
568
568
  .mds-font-body-copy, body {
569
- font-size: 16px;
569
+ font-size: 1rem;
570
570
  line-height: 1.38;
571
571
  }
572
572
  }
573
573
 
574
574
  @media (min-width: 37.5em) {
575
575
  .mds-font-body-copy, body {
576
- font-size: 18px;
576
+ font-size: 1.125rem;
577
577
  line-height: 1.34;
578
578
  }
579
579
  }
580
580
 
581
581
  @media (min-width: 63em) {
582
582
  .mds-font-body-copy, body {
583
- font-size: 16px;
583
+ font-size: 1rem;
584
584
  line-height: 1.38;
585
585
  }
586
586
  }
587
587
 
588
588
  .mds-font-pica {
589
- font-size: 15px;
589
+ font-size: 0.9375rem;
590
590
  line-height: 1.34;
591
591
  }
592
592
 
593
593
  @media (min-width: 25em) {
594
594
  .mds-font-pica {
595
- font-size: 16px;
595
+ font-size: 1rem;
596
596
  line-height: 1.25;
597
597
  }
598
598
  }
599
599
 
600
600
  @media (min-width: 37.5em) {
601
601
  .mds-font-pica {
602
- font-size: 18px;
602
+ font-size: 1.125rem;
603
603
  line-height: 1.23;
604
604
  }
605
605
  }
606
606
 
607
607
  @media (min-width: 63em) {
608
608
  .mds-font-pica {
609
- font-size: 16px;
609
+ font-size: 1rem;
610
610
  line-height: 1.25;
611
611
  }
612
612
  }
613
613
 
614
614
  .mds-font-long-primer {
615
- font-size: 15px;
615
+ font-size: 0.9375rem;
616
616
  line-height: 1.2;
617
617
  }
618
618
 
619
619
  @media (min-width: 25em) {
620
620
  .mds-font-long-primer {
621
- font-size: 15px;
621
+ font-size: 0.9375rem;
622
622
  line-height: 1.2;
623
623
  }
624
624
  }
625
625
 
626
626
  @media (min-width: 37.5em) {
627
627
  .mds-font-long-primer {
628
- font-size: 15px;
628
+ font-size: 0.9375rem;
629
629
  line-height: 1.34;
630
630
  }
631
631
  }
632
632
 
633
633
  @media (min-width: 63em) {
634
634
  .mds-font-long-primer {
635
- font-size: 14px;
635
+ font-size: 0.875rem;
636
636
  line-height: 1.29;
637
637
  }
638
638
  }
639
639
 
640
640
  .mds-font-brevier {
641
- font-size: 14px;
641
+ font-size: 0.875rem;
642
642
  line-height: 1.15;
643
643
  }
644
644
 
645
645
  @media (min-width: 25em) {
646
646
  .mds-font-brevier {
647
- font-size: 14px;
647
+ font-size: 0.875rem;
648
648
  line-height: 1.29;
649
649
  }
650
650
  }
651
651
 
652
652
  @media (min-width: 37.5em) {
653
653
  .mds-font-brevier {
654
- font-size: 14px;
654
+ font-size: 0.875rem;
655
655
  line-height: 1.29;
656
656
  }
657
657
  }
658
658
 
659
659
  @media (min-width: 63em) {
660
660
  .mds-font-brevier {
661
- font-size: 13px;
661
+ font-size: 0.8125rem;
662
662
  line-height: 1.24;
663
663
  }
664
664
  }
665
665
 
666
666
  .mds-font-minion, .mds-list__key {
667
- font-size: 12px;
667
+ font-size: 0.75rem;
668
668
  line-height: 1.34;
669
669
  }
670
670
 
671
671
  @media (min-width: 25em) {
672
672
  .mds-font-minion, .mds-list__key {
673
- font-size: 12px;
673
+ font-size: 0.75rem;
674
674
  line-height: 1.34;
675
675
  }
676
676
  }
677
677
 
678
678
  @media (min-width: 37.5em) {
679
679
  .mds-font-minion, .mds-list__key {
680
- font-size: 13px;
680
+ font-size: 0.8125rem;
681
681
  line-height: 1.24;
682
682
  }
683
683
  }
684
684
 
685
685
  @media (min-width: 63em) {
686
686
  .mds-font-minion, .mds-list__key {
687
- font-size: 12px;
687
+ font-size: 0.75rem;
688
688
  line-height: 1.34;
689
689
  }
690
690
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgex/design-system",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "scripts": {
5
5
  "clean": "rimraf dist public tokens/build",
6
6
  "commit": "commit",
@@ -1 +1,2 @@
1
1
  @import 'color';
2
+ @import 'px2rem';
@@ -0,0 +1,20 @@
1
+ /// Convert pixels to rems
2
+ ///
3
+ /// @param {Number} $px - value to convert
4
+ /// @param {Number} $base-size ($mds-font-size-base) - `<body>` font size
5
+ ///
6
+ /// @example scss
7
+ /// $font-size-in-rems: px2rem(16px);
8
+ /// p { font-size: px2rem(16px); }
9
+ ///
10
+ /// @requires $mds-font-size-base
11
+ /// @returns {Number}
12
+ @function px2rem($px, $base-size: $mds-font-size-base) {
13
+ @if unitless($px) {
14
+ @warn "Assuming #{$px} to be in pixels, attempting to convert it into pixels.";
15
+ @return px2rem($px * 1px, $base-size);
16
+ } @else if unit($px) == rem {
17
+ @return $px;
18
+ }
19
+ @return ($px / $base-size) * 1rem;
20
+ }
@@ -24,11 +24,11 @@ $font-types: map-get(map-get($tokens, 'font'), 'type');
24
24
  .mds-font-#{$typename} {
25
25
  @each $bpname, $props in $typevalue {
26
26
  @if $bpname == 'default' {
27
- font-size: map-get($props, 'size');
27
+ font-size: px2rem(map-get($props, 'size'));
28
28
  line-height: map-get($props, 'line-height');
29
29
  } @else {
30
30
  @include mq($from: $bpname) {
31
- font-size: map-get($props, 'size');
31
+ font-size: px2rem(map-get($props, 'size'));
32
32
  line-height: map-get($props, 'line-height');
33
33
  }
34
34
  }
@@ -1,8 +1,8 @@
1
1
  @import '../../dist/_tokens/scss/tokens';
2
2
  @import 'resets/_index';
3
3
  @import 'vendor/normalize';
4
- @import 'helpers/_index';
5
4
  @import 'functions/_index';
5
+ @import 'helpers/_index';
6
6
  @import 'utilities/_index';
7
7
  @import 'core/_index';
8
8
 
@@ -5,6 +5,11 @@
5
5
  "value": "\"Helvetica\", Arial, sans-serif"
6
6
  }
7
7
  },
8
+ "size": {
9
+ "base": {
10
+ "value": "16px"
11
+ }
12
+ },
8
13
  "type": {
9
14
  "canon": {
10
15
  "default": {