@documental-xyz/core 0.1.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.
Files changed (114) hide show
  1. package/README.md +424 -0
  2. package/integration.ts +113 -0
  3. package/package.json +83 -0
  4. package/src/admin/admin.astro +29 -0
  5. package/src/assets/scripts/App.js +70 -0
  6. package/src/assets/scripts/EnteringAnimations.js +34 -0
  7. package/src/assets/scripts/MapBoxHandler.js +680 -0
  8. package/src/assets/scripts/ScrollProgressionBar.js +24 -0
  9. package/src/assets/scripts/utils/ScrollObserver.js +166 -0
  10. package/src/assets/styles/config/_breakpoints.scss +37 -0
  11. package/src/assets/styles/config/_colors.scss +8 -0
  12. package/src/assets/styles/config/_config.scss +5 -0
  13. package/src/assets/styles/config/_functions.scss +90 -0
  14. package/src/assets/styles/config/_grrr.configs.scss +7 -0
  15. package/src/assets/styles/config/_mixins.scss +207 -0
  16. package/src/assets/styles/config/_type.scss +175 -0
  17. package/src/assets/styles/config/_vars.scss +16 -0
  18. package/src/assets/styles/globals/_content.scss +47 -0
  19. package/src/assets/styles/globals/_grrr.scss +18 -0
  20. package/src/assets/styles/globals/_html.scss +25 -0
  21. package/src/assets/styles/globals/_lists.scss +19 -0
  22. package/src/assets/styles/globals/_map-anchors.scss +32 -0
  23. package/src/assets/styles/globals/_reset.scss +240 -0
  24. package/src/assets/styles/globals/_reveal-animations.scss +104 -0
  25. package/src/assets/styles/globals/_root.scss +6 -0
  26. package/src/assets/styles/globals/_scroll-progression-bar.scss +8 -0
  27. package/src/assets/styles/main.scss +17 -0
  28. package/src/assets/styles/utils/.gitkeep +0 -0
  29. package/src/assets/styles/utils/grrr/_grrr.scss +433 -0
  30. package/src/assets/styles/utils/list-styles/_list-styles.scss +190 -0
  31. package/src/components/AnimationToggle.astro +19 -0
  32. package/src/components/BigNumbers.astro +83 -0
  33. package/src/components/Button.astro +49 -0
  34. package/src/components/Caption.astro +15 -0
  35. package/src/components/Card.astro +68 -0
  36. package/src/components/Cards.astro +66 -0
  37. package/src/components/CardsCall.astro +125 -0
  38. package/src/components/ChartBar.astro +217 -0
  39. package/src/components/ChartPercentage.astro +137 -0
  40. package/src/components/Column.astro +54 -0
  41. package/src/components/ColumnSticky.astro +129 -0
  42. package/src/components/Columns.astro +139 -0
  43. package/src/components/Compare.astro +266 -0
  44. package/src/components/Cta.astro +242 -0
  45. package/src/components/Gallery.astro +594 -0
  46. package/src/components/Group.astro +140 -0
  47. package/src/components/HtmlEmbed.astro +98 -0
  48. package/src/components/ImageBlock.astro +134 -0
  49. package/src/components/InnerColumns.astro +54 -0
  50. package/src/components/LogosGroup.astro +102 -0
  51. package/src/components/Map.astro +321 -0
  52. package/src/components/MapBox.astro +96 -0
  53. package/src/components/MapView.astro +30 -0
  54. package/src/components/Menu.astro +278 -0
  55. package/src/components/Pullquote.astro +46 -0
  56. package/src/components/Slider.astro +223 -0
  57. package/src/components/Spacer.astro +25 -0
  58. package/src/components/Text.astro +173 -0
  59. package/src/components/TextPlaceholder.astro +98 -0
  60. package/src/components/Timeline.astro +73 -0
  61. package/src/components/TimelineBullet.astro +67 -0
  62. package/src/components/VideoEmbed.astro +99 -0
  63. package/src/content/loader.ts +29 -0
  64. package/src/content/pages/alter-ameacada.md +80 -0
  65. package/src/content/pages/expulsions.md +1447 -0
  66. package/src/content/pages/home.md +346 -0
  67. package/src/content/pages/nhanderekoa-studio-autonoma.md +3113 -0
  68. package/src/content/pages/nhanderekoa-terra-ind/303/255gena-jaragu/303/241.md +3806 -0
  69. package/src/content/pages/nova-landing-page.md +546 -0
  70. package/src/content/pages/territ/303/263rios-de-exce/303/247/303/243o.md +2199 -0
  71. package/src/content/pages/teste-alter-do-chao.md +955 -0
  72. package/src/content/pages/teste-layout.md +1484 -0
  73. package/src/content/pages/thiago.md +93 -0
  74. package/src/content/schema/blog.ts +11 -0
  75. package/src/content/schema/geostorys.ts +13 -0
  76. package/src/content/schema/index.ts +3 -0
  77. package/src/content/schema/pages.ts +494 -0
  78. package/src/content.config.ts +49 -0
  79. package/src/env.d.ts +1 -0
  80. package/src/integration/override-aliases.ts +67 -0
  81. package/src/layouts/components/ButtonLayout.astro +8 -0
  82. package/src/layouts/components/CardLayout.astro +8 -0
  83. package/src/layouts/components/CardsCallLayout.astro +26 -0
  84. package/src/layouts/components/CardsLayout.astro +14 -0
  85. package/src/layouts/components/ChartBarLayout.astro +21 -0
  86. package/src/layouts/components/ChartPercentageLayout.astro +17 -0
  87. package/src/layouts/components/ColumnLayout.astro +11 -0
  88. package/src/layouts/components/ColumnStickyLayout.astro +10 -0
  89. package/src/layouts/components/ColumnsLayout.astro +13 -0
  90. package/src/layouts/components/CompareLayout.astro +22 -0
  91. package/src/layouts/components/CtaLayout.astro +91 -0
  92. package/src/layouts/components/GalleryLayout.astro +24 -0
  93. package/src/layouts/components/GroupLayout.astro +53 -0
  94. package/src/layouts/components/HtmlEmbedLayout.astro +18 -0
  95. package/src/layouts/components/ImageBlockLayout.astro +20 -0
  96. package/src/layouts/components/InnerColumnsLayout.astro +14 -0
  97. package/src/layouts/components/LogosGroupLayout.astro +22 -0
  98. package/src/layouts/components/MapLayout.astro +41 -0
  99. package/src/layouts/components/MapViewLayout.astro +8 -0
  100. package/src/layouts/components/MapboxLayout.astro +248 -0
  101. package/src/layouts/components/PullquoteLayout.astro +13 -0
  102. package/src/layouts/components/SliderLayout.astro +18 -0
  103. package/src/layouts/components/SpacerLayout.astro +8 -0
  104. package/src/layouts/components/TextLayout.astro +17 -0
  105. package/src/layouts/components/TextPlaceholderLayout.astro +7 -0
  106. package/src/layouts/components/TimelineBulletLayout.astro +14 -0
  107. package/src/layouts/components/TimelineLayout.astro +10 -0
  108. package/src/layouts/components/VideoEmbedLayout.astro +28 -0
  109. package/src/layouts/pages/Layout.astro +90 -0
  110. package/src/layouts/pages/PageLayout.astro +200 -0
  111. package/src/lib/collections.ts +1 -0
  112. package/src/routes/[slug].astro +17 -0
  113. package/src/routes/index.astro +5 -0
  114. package/src/vite/yaml-merge-plugin.ts +234 -0
@@ -0,0 +1,166 @@
1
+ export default class ScrollObserver {
2
+ constructor(options = {}) {
3
+ this.options = {
4
+ threshold: options.threshold || [0, 1],
5
+ rootMargin: options.rootMargin || '0px',
6
+ throttleWait: options.throttleWait || 10 // ms entre atualizações do scroll
7
+ };
8
+
9
+ this.observers = new Map();
10
+ this.scrollListeners = new Map();
11
+ this.visibleElements = new Set();
12
+ }
13
+
14
+ // Função de throttle para otimizar o scroll
15
+ throttle(func, wait) {
16
+ let timeout = null;
17
+ let previous = 0;
18
+
19
+ return function(...args) {
20
+ const now = Date.now();
21
+ const remaining = wait - (now - previous);
22
+
23
+ if (remaining <= 0 || remaining > wait) {
24
+ if (timeout) {
25
+ clearTimeout(timeout);
26
+ timeout = null;
27
+ }
28
+ previous = now;
29
+ func.apply(this, args);
30
+ } else if (!timeout) {
31
+ timeout = setTimeout(() => {
32
+ previous = Date.now();
33
+ timeout = null;
34
+ func.apply(this, args);
35
+ }, remaining);
36
+ }
37
+ };
38
+ }
39
+
40
+ // Observa um elemento específico
41
+ observe(element, callback) {
42
+ if (!element || !(element instanceof Element)) {
43
+ console.error('Elemento inválido');
44
+ return;
45
+ }
46
+
47
+ // Remove observadores existentes
48
+ this.unobserve(element);
49
+
50
+ // Cria o intersection observer
51
+ const intersectionObserver = new IntersectionObserver((entries) => {
52
+ entries.forEach((entry) => {
53
+ const isVisible = entry.isIntersecting;
54
+
55
+ if (isVisible) {
56
+ // Quando o elemento se torna visível
57
+ this.visibleElements.add(element);
58
+ this.startScrollTracking(element, callback);
59
+ } else {
60
+ // Quando o elemento sai da vista
61
+ this.visibleElements.delete(element);
62
+ this.stopScrollTracking(element);
63
+ }
64
+
65
+ // Callback inicial com dados da intersecção
66
+ const data = {
67
+ isVisible,
68
+ intersectionRatio: entry.intersectionRatio,
69
+ boundingRect: entry.boundingClientRect,
70
+ element: entry.target,
71
+ scrollPosition: window.scrollY
72
+ };
73
+
74
+ callback(data);
75
+ });
76
+ }, this.options);
77
+
78
+ // Armazena o observer
79
+ this.observers.set(element, intersectionObserver);
80
+
81
+ // Inicia a observação
82
+ intersectionObserver.observe(element);
83
+ }
84
+
85
+ // Inicia o tracking de scroll para um elemento
86
+ startScrollTracking(element, callback) {
87
+ const handleScroll = () => {
88
+ if (this.visibleElements.has(element)) {
89
+ const boundingRect = element.getBoundingClientRect();
90
+ const data = {
91
+ isVisible: true,
92
+ intersectionRatio: this.calculateVisibleRatio(boundingRect),
93
+ boundingRect,
94
+ element,
95
+ scrollPosition: window.scrollY
96
+ };
97
+ callback(data);
98
+ }
99
+ };
100
+
101
+ // Cria versão throttled do handler
102
+ const throttledHandler = this.throttle(handleScroll, this.options.throttleWait);
103
+
104
+ // Armazena referência ao listener
105
+ this.scrollListeners.set(element, throttledHandler);
106
+
107
+ // Adiciona event listener
108
+ window.addEventListener('scroll', throttledHandler, { passive: true });
109
+ }
110
+
111
+ // Calcula quanto do elemento está visível
112
+ calculateVisibleRatio(boundingRect) {
113
+ const windowHeight = window.innerHeight;
114
+ const elementHeight = boundingRect.height;
115
+
116
+ // Se o elemento estiver completamente fora da vista
117
+ if (boundingRect.bottom < 0 || boundingRect.top > windowHeight) {
118
+ return 0;
119
+ }
120
+
121
+ // Se estiver completamente visível
122
+ if (boundingRect.top >= 0 && boundingRect.bottom <= windowHeight) {
123
+ return 1;
124
+ }
125
+
126
+ // Calcula a parte visível
127
+ const visibleHeight = Math.min(boundingRect.bottom, windowHeight) -
128
+ Math.max(boundingRect.top, 0);
129
+ return visibleHeight / elementHeight;
130
+ }
131
+
132
+ // Para o tracking de scroll para um elemento
133
+ stopScrollTracking(element) {
134
+ const scrollHandler = this.scrollListeners.get(element);
135
+ if (scrollHandler) {
136
+ window.removeEventListener('scroll', scrollHandler);
137
+ this.scrollListeners.delete(element);
138
+ }
139
+ }
140
+
141
+ // Para de observar um elemento
142
+ unobserve(element) {
143
+ // Remove intersection observer
144
+ const observer = this.observers.get(element);
145
+ if (observer) {
146
+ observer.disconnect();
147
+ this.observers.delete(element);
148
+ }
149
+
150
+ // Remove scroll listener
151
+ this.stopScrollTracking(element);
152
+ this.visibleElements.delete(element);
153
+ }
154
+
155
+ // Desconecta todos os observers e listeners
156
+ disconnectAll() {
157
+ this.observers.forEach((observer) => observer.disconnect());
158
+ this.observers.clear();
159
+
160
+ this.scrollListeners.forEach((listener, element) => {
161
+ window.removeEventListener('scroll', listener);
162
+ });
163
+ this.scrollListeners.clear();
164
+ this.visibleElements.clear();
165
+ }
166
+ }
@@ -0,0 +1,37 @@
1
+ $breakpoints: (
2
+ 'c': ('breakpoint': false,
3
+ 'gutter': 30px,
4
+ 'margin': 30px,
5
+ 'cols': 4,
6
+ ),
7
+ 'xs': ('breakpoint': 321px,
8
+ 'gutter': 30px,
9
+ 'margin': 30px,
10
+ 'cols': 4,
11
+ ),
12
+ 's': ('breakpoint': 576px,
13
+ 'gutter': 30px,
14
+ 'margin': 30px,
15
+ 'cols': 4,
16
+ ),
17
+ 'm': ('breakpoint': 768px,
18
+ 'gutter': 40px,
19
+ 'margin': 40px,
20
+ 'cols': 12,
21
+ ),
22
+ 'l': ('breakpoint': 992px,
23
+ 'gutter': 40px,
24
+ 'margin': 40px,
25
+ 'cols': 12,
26
+ ),
27
+ 'x': ('breakpoint': 1280px,
28
+ 'gutter': 40px,
29
+ 'margin': 40px,
30
+ 'cols': 12,
31
+ ),
32
+ 'xl': ('breakpoint': 1440px,
33
+ 'gutter': 40px,
34
+ 'margin': 40px,
35
+ 'cols': 12,
36
+ ),
37
+ );
@@ -0,0 +1,8 @@
1
+ $colors: (
2
+ 'black': (#000000, #FFFFFF),
3
+ 'white': (#FFFFFF,#000000),
4
+ 'highlight': (#FF7967, #FF7967),
5
+ 'bg-highlight': (#000000, #FFFFFF),
6
+ ) !default;
7
+
8
+ $color-var-prefix: "clr";
@@ -0,0 +1,5 @@
1
+ @forward 'breakpoints';
2
+ @forward 'functions';
3
+ @forward 'mixins';
4
+ @forward '../globals/grrr';
5
+ @forward 'vars';
@@ -0,0 +1,90 @@
1
+ @use "sass:color";
2
+ @use "sass:list";
3
+ @use "sass:map";
4
+
5
+ @use "./colors" as *;
6
+
7
+ @function pxToRem($px) {
8
+ $remUnit: 0.0625;
9
+ $rem: $px * $remUnit * 1rem;
10
+ @return $rem;
11
+ }
12
+
13
+ @function pxToVw($px, $viewportWidth: 1440) {
14
+ @return calc(100vw / $viewportWidth * $px);
15
+ }
16
+
17
+ @function sqrt($r) {
18
+ $x0: 1;
19
+ $x1: $x0;
20
+ @for $i from 1 through 10 {
21
+ $x1: $x0 - calc(($x0 * $x0 - abs($r)) / (2 * $x0));
22
+ $x0: $x1;
23
+ }
24
+ @return $x1;
25
+ }
26
+
27
+ @function strip-unit($number) {
28
+ @if type-of($number)=='number' and not unitless($number) {
29
+ $n: $number * 0 + 1;
30
+ @return calc($number / $n);
31
+ }
32
+ @return $number;
33
+ }
34
+
35
+ @function str-split($string, $separator) {
36
+ $split-arr: ();
37
+ $index : str-index($string, $separator);
38
+ @while $index !=null {
39
+ $item: str-slice($string, 1, $index - 1);
40
+ $split-arr: append($split-arr, $item);
41
+ $string: str-slice($string, $index + 1);
42
+ $index : str-index($string, $separator);
43
+ }
44
+ $split-arr: append($split-arr, $string);
45
+ @return $split-arr;
46
+ }
47
+
48
+ @function str-replace($string, $search, $replace: '') {
49
+ $index: str-index($string, $search);
50
+ @if $index {
51
+ @return str-slice($string, 1, $index - 1) + $replace + str-replace( str-slice($string, $index + str-length($search)), $search, $replace);
52
+ }
53
+ @return $string;
54
+ }
55
+
56
+ @function hex_to_rgb_values($hex) {
57
+ @return #{color.channel($hex, "red", rgb)}, #{color.channel($hex, "green", rgb)}, #{color.channel($hex, "blue", rgb)};
58
+ }
59
+
60
+ @function color($color, $alpha: 1) {
61
+ @if not map.get($colors, $color) {
62
+ @warn '-> "' + #{$color} + '" is not defined in colors configs';
63
+ }
64
+ @return rgba(var(--#{$color-var-prefix}-#{$color}-rgb), $alpha);
65
+ }
66
+
67
+ @function colorHex($color, $index: 1) {
68
+ @if not map.get($colors, $color) {
69
+ @warn '-> "' + #{$color} + '" is not defined in colors configs';
70
+ }
71
+
72
+ @return list.nth(map.get($colors, $color), $index);
73
+ }
74
+
75
+ @function columnsSize($cols, $gridCols: false, $grid-config: $grid-config) {
76
+ $name: map.get($map: $grid-config, $key: 'name' );
77
+ $colsSize: calcColumnSize($gridCols, var(--#{$name}-gutter));
78
+
79
+ @if($gridCols == false) {
80
+ $colsSize: var(--#{$name}-col-size);
81
+ }
82
+
83
+ @return calc(($colsSize + var(--#{$name}-gutter)) * $cols);
84
+ }
85
+
86
+ @function calcColumnSize($gridCols, $gutter, $width: 100%) {
87
+ $gutter-calc: calc(#{$gutter} * (#{$gridCols} - 1) / #{$gridCols});
88
+
89
+ @return calc(#{$width} / #{$gridCols} - #{$gutter-calc});
90
+ }
@@ -0,0 +1,7 @@
1
+ @use './breakpoints' as *;
2
+
3
+ $grrr-config: (
4
+ 'name': 'atnl', // id que será usada como prefixo das classes
5
+ 'board-max': 1356px, // tamanho máximo do board,
6
+ 'breakpoints': $breakpoints, //array de breakpoints
7
+ );
@@ -0,0 +1,207 @@
1
+ @use "sass:map";
2
+ @use "sass:list";
3
+ @use './functions' as *;
4
+ @use './breakpoints' as *;
5
+ @use './type' as *;
6
+ @use './colors' as *;
7
+
8
+ //MIXINS
9
+ //varname: gera uma variável no escopo css ao adicionar o tamanho
10
+ @mixin fontSize($px,$varname: false, $root: false, $responsive: false){
11
+ @if($varname == false){
12
+ font-size: $px*1px;
13
+ font-size: pxToRem($px);
14
+ @if($responsive == true){ font-size: pxToVw($px);}
15
+ }@else{
16
+ @if($root != false){
17
+ #{--#{$type-var-prefix}-#{$varname}-fs-px}: $px*1px;
18
+ #{--#{$type-var-prefix}-#{$varname}-fs-rem}: pxToRem($px);
19
+ @if($responsive == true){ #{--#{$type-var-prefix}-#{$varname}-fs-vw}: pxToVw($px) };
20
+ }@else{
21
+ font-size: $px*1px;
22
+ font-size: var(--#{$type-var-prefix}-#{$varname}-fs-px,$px*1px);
23
+ font-size: var(--#{$type-var-prefix}-#{$varname}-fs-rem,pxToRem($px));
24
+ @if($responsive == true){ font-size:var(--#{$type-var-prefix}-#{$varname}-fs-vw,pxToVw($px)) };
25
+ }
26
+ }
27
+ }
28
+
29
+ @mixin lineHeight($pt, $varname:false, $root: false ){
30
+ @if($varname == false){
31
+ line-height: calc( round($pt * 1000) / 1000 );
32
+ }@else{
33
+ @if($root != false){
34
+ #{--#{$type-var-prefix}-#{$varname}-lh}: calc( round($pt * 1000) / 1000 );
35
+ }@else{
36
+ line-height: var(--#{$type-var-prefix}-#{$varname}-lh, calc( round($pt * 1000) / 1000) );
37
+ }
38
+ }
39
+ }
40
+
41
+ //insira a porcentagem conforme XD, aceita negativos
42
+ @mixin letterSpacing($fontSizeInPx,$letterSpacingPercentage,$varname: false, $root: false, $responsive: false){
43
+ $ls: calc($fontSizeInPx / 100 ) * $letterSpacingPercentage;
44
+
45
+ @if($varname == false){
46
+ letter-spacing: $ls * 1px;
47
+ letter-spacing: pxToRem($ls);
48
+ @if($responsive == true){ letter-spacing: pxToVw($ls);}
49
+ }@else{
50
+ @if($root != false){
51
+ #{--#{$type-var-prefix}-#{$varname}-ls-px}: $ls * 1px;
52
+ #{--#{$type-var-prefix}-#{$varname}-ls-rem}: pxToRem($ls);
53
+ @if($responsive == true){ #{--#{$type-var-prefix}-#{$varname}-ls-vw}: pxToVw($ls);}
54
+ }@else{
55
+ letter-spacing: $ls * 1px;
56
+ letter-spacing: var(--#{$type-var-prefix}-#{$varname}-ls-px,$ls * 1px);
57
+ letter-spacing: var(--#{$type-var-prefix}-#{$varname}-ls-rem,pxToRem($ls));
58
+ @if($responsive == true){ letter-spacing: var(--#{$type-var-prefix}-#{$varname}-ls-vw,pxToVw($ls)); }
59
+ }
60
+ }
61
+ }
62
+
63
+ @mixin defineFont($varName: false, $fontSizePx: false, $lineHeight: false, $letterSpacing: false, $root: false, $responsive: false){
64
+ @if( $fontSizePx != false ) { @include fontSize($fontSizePx,$varName,$root,$responsive) };
65
+ @if( $lineHeight != false ) { @include lineHeight($lineHeight,$varName,$root) };
66
+ @if( $letterSpacing != false and $fontSizePx != false ) { @include letterSpacing($fontSizePx, $letterSpacing, $varName, $root, $responsive) };
67
+ }
68
+
69
+ //renderiza variáveis de acordo com objeto types no root
70
+ @mixin typeVars($types:$types){
71
+ @each $type,$rows in $types{
72
+ $varName: $type;
73
+
74
+ @each $row in $rows{
75
+ $fontSize: false;
76
+ $lineHeight: false;
77
+ $letterSpacing: false;
78
+ $responsive: false;
79
+
80
+ @if( map.get($map: $row, $key: 'font-size') ){$fontSize: map.get($map: $row, $key: 'font-size')};
81
+ @if( map.get($map: $row, $key: 'line-height') ){$lineHeight: map.get($map: $row, $key: 'line-height')};
82
+ @if( map.get($map: $row, $key: 'letter-spacing') ){$letterSpacing: map.get($map: $row, $key: 'letter-spacing')};
83
+ @if( map.get($map: $row, $key: 'responsive') ){$responsive: map.get($map: $row, $key: 'responsive')};
84
+
85
+ @if( map.get($map: $row, $key: 'break') == false){
86
+ @include defineFont($varName, $fontSize, $lineHeight, $letterSpacing, true, $responsive);
87
+ }@else{
88
+ $break: map.get($map: $row, $key: 'break');
89
+ $varNameSufix: $varName + '-' + map.get($map: $break, $key: 'mixin') + '-' + str-replace(map.get($map: $break, $key: 'point'),',','-');
90
+ @include defineFont($varNameSufix, $fontSize, $lineHeight, $letterSpacing, true, $responsive );
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ //usado para definir fontes
97
+ @mixin type($name){
98
+ $type: map.get($map: $types, $key: $name);
99
+
100
+ @if($type == null){ @error '-> "' + #{$name} + '" not defined at config/type.scss'; }
101
+
102
+ @each $row in $type{
103
+ $fontSize: false;
104
+ $lineHeight: false;
105
+ $letterSpacing: false;
106
+ $responsive: false;
107
+
108
+ @if( map.get($map: $row, $key: 'font-size') ){$fontSize: map.get($map: $row, $key: 'font-size')};
109
+ @if( map.get($map: $row, $key: 'line-height') ){$lineHeight: map.get($map: $row, $key: 'line-height')};
110
+ @if( map.get($map: $row, $key: 'letter-spacing') ){$letterSpacing: map.get($map: $row, $key: 'letter-spacing')};
111
+ @if( map.get($map: $row, $key: 'responsive') ){$responsive: map.get($map: $row, $key: 'responsive')};
112
+
113
+ $break: map.get($map: $row, $key: 'break');
114
+ @if( $break == false){
115
+ @include defineFont($name, $fontSize, $lineHeight, $letterSpacing, false, $responsive);
116
+ @include typeValues($row);
117
+ }
118
+
119
+ @if( $break != false and map.get($map: $break, $key: 'mixin') == 'down'){
120
+ @include media-break-down( map.get($map: $break, $key: 'point'), map.get($map: $break, $key: 'vars')){
121
+ $varNameSufix: $name + '-' + map.get($map: $break, $key: 'mixin') + '-' + map.get($map: $break, $key: 'point');
122
+ @include defineFont($varNameSufix, $fontSize, $lineHeight, $letterSpacing, false, $responsive);
123
+ @include typeValues($row);
124
+ };
125
+ }
126
+
127
+ @if( $break != false and map.get($map: $break, $key: 'mixin') == 'up'){
128
+ @include media-break-up( map.get($map: $break, $key: 'point'), map.get($map: $break, $key: 'vars')){
129
+ $varNameSufix: $name + '-' + map.get($map: $break, $key: 'mixin') + '-' + map.get($map: $break, $key: 'point');
130
+ @include defineFont($varNameSufix, $fontSize, $lineHeight, $letterSpacing, false, $responsive);
131
+ @include typeValues($row);
132
+ };
133
+ }
134
+
135
+ @if( $break != false and map.get($map: $break, $key: 'mixin') == 'between'){
136
+ @include media-break-between( list.nth(str-split(map.get($map: $break, $key: 'point'),','),1), list.nth(str-split(map.get($map: $break, $key: 'point'),','),2), map.get($map: $break, $key: 'vars')){
137
+ $varNameSufix: $name + '-' + map.get($map: $break, $key: 'mixin') + '-' + str-replace(map.get($map: $break, $key: 'point'),',','-');
138
+ @include defineFont($varNameSufix, $fontSize, $lineHeight, $letterSpacing, false, $responsive);
139
+ @include typeValues($row);
140
+ };
141
+ }
142
+ }
143
+ }
144
+
145
+
146
+ //usado para pegar valores de type
147
+ @mixin typeValues($row){
148
+ @each $key,$val in $row{
149
+ @if($key != 'font-size' and $key != 'line-height' and $key != 'letter-spacing' and $key != 'break' and $key != 'responsive'){
150
+ #{$key}: $val;
151
+ }
152
+ }
153
+ }
154
+
155
+ @mixin media-break-up($breakname,$breakpoints: $breakpoints) {
156
+ $this_break: map.get($map: $breakpoints, $key: $breakname);
157
+ $break-px: map.get($map: $this_break, $key: 'breakpoint');;
158
+
159
+ @media (min-width: $break-px) {
160
+ @content;
161
+ }
162
+ }
163
+
164
+ @mixin media-break-down($breakname,$breakpoints: $breakpoints) {
165
+ $this_break: map.get($map: $breakpoints, $key: $breakname);
166
+ $break-px: map.get($map: $this_break, $key: 'breakpoint') - 1px;
167
+
168
+ @media (max-width: $break-px) {
169
+ @content;
170
+ }
171
+ }
172
+
173
+ @mixin media-break-between($breakname-lower, $breakname-upper,$breakpoints: $breakpoints) {
174
+ $break-down: map.get($map: $breakpoints, $key: $breakname-lower);
175
+ $break-down: map.get($map: $break-down, $key: 'breakpoint');
176
+ $break-up: map.get($map: $breakpoints, $key: $breakname-upper);
177
+ $break-up: map.get($map: $break-up, $key: 'breakpoint') - 1px;
178
+
179
+ @media (min-width: $break-down ) and (max-width: $break-up ) {
180
+ @content;
181
+ }
182
+ }
183
+
184
+ // insere as varáveis das cores definidas
185
+ @mixin print_colors_vars( $colors: $colors, $user_system_prefs: false){
186
+ @each $name, $arr in $colors {
187
+ --#{$color-var-prefix}-#{$name}: #{list.nth($arr,1)};
188
+ --#{$color-var-prefix}-#{$name}-rgb: #{hex_to_rgb_values(list.nth($arr,1))};
189
+ }
190
+
191
+ &[darkmode] {
192
+ @each $name,$arr in $colors {
193
+ --#{$color-var-prefix}-#{$name}: #{list.nth($arr,2)};
194
+ --#{$color-var-prefix}-#{$name}-rgb: #{hex_to_rgb_values((list.nth($arr,2)))};
195
+ }
196
+ }
197
+
198
+ @if($user_system_prefs) {
199
+ @media (prefers-color-scheme: dark) {
200
+ @each $name,$arr in $colors {
201
+ --#{$color-var-prefix}-#{$name}: #{list.nth($arr,2)};
202
+ --#{$color-var-prefix}-#{$name}-rgb: #{hex_to_rgb_values((list.nth($arr,2)))};
203
+ }
204
+ }
205
+ }
206
+ }
207
+
@@ -0,0 +1,175 @@
1
+ @use './breakpoints' as *;
2
+
3
+ @import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
4
+
5
+ //fonts family variables
6
+ $type-var-prefix: "tp";
7
+ $mainfont: "Noto Serif";
8
+ $displayfont: "Rubik";
9
+
10
+ $types : (
11
+ 'b-xs': (('break': false,
12
+ 'responsive': false,
13
+ 'font-size': 12,
14
+ 'line-height': 1.333,
15
+ 'font-weight': 400,
16
+ 'font-family': var(--ff-text, $mainfont),
17
+ ),
18
+ ),
19
+
20
+ 'b-s': (('break': false,
21
+ 'responsive': false,
22
+ 'font-size': 14,
23
+ 'line-height': 1.42,
24
+ 'font-weight': 400,
25
+ 'font-family': var(--ff-text, $mainfont),
26
+ ),
27
+ ),
28
+
29
+ 'b-m': (('break': false,
30
+ 'responsive': false,
31
+ 'font-size': 16,
32
+ 'line-height': 1.5,
33
+ 'font-weight': 400,
34
+ 'font-family': var(--ff-text, $mainfont),
35
+ ),
36
+ ),
37
+
38
+ 'c-xs': (('break': false,
39
+ 'responsive': false,
40
+ 'font-size': 12,
41
+ 'line-height': 1.333,
42
+ 'font-weight': 400,
43
+ 'font-family': var(--ff-display, $displayfont),
44
+ ),
45
+ ),
46
+
47
+ 'c-s': (('break': false,
48
+ 'responsive': false,
49
+ 'font-size': 14,
50
+ 'line-height': 1.42,
51
+ 'font-weight': 400,
52
+ 'font-family': var(--ff-display, $displayfont),
53
+ ),
54
+ ),
55
+
56
+ 'c-m': (('break': false,
57
+ 'responsive': false,
58
+ 'font-size': 16,
59
+ 'line-height': 1.5,
60
+ 'font-weight': 400,
61
+ 'font-family': var(--ff-display, $displayfont),
62
+ ),
63
+ ),
64
+
65
+ 'h-xs': (('break': false,
66
+ 'responsive': false,
67
+ 'font-size': 20,
68
+ 'line-height': 1.4,
69
+ 'font-weight': 700,
70
+ 'letter-spacing': -2,
71
+ 'font-family': var(--ff-display, $displayfont),
72
+ ),
73
+ ),
74
+
75
+ 'h-s': (('break': false,
76
+ 'responsive': false,
77
+ 'font-size': 24,
78
+ 'line-height': 1.333,
79
+ 'font-weight': 700,
80
+ 'letter-spacing': -2,
81
+ 'font-family': var(--ff-display, $displayfont),
82
+ ),
83
+ ),
84
+
85
+ 'h-m': (('break': false,
86
+ 'responsive': false,
87
+ 'font-size': 28,
88
+ 'line-height': 1.28,
89
+ 'font-weight': 700,
90
+ 'letter-spacing': -2,
91
+ 'font-family': var(--ff-display, $displayfont),
92
+ ),
93
+ ),
94
+
95
+ 'h-l': (('break': false,
96
+ 'responsive': false,
97
+ 'font-size': 32,
98
+ 'line-height': 1.25,
99
+ 'font-weight': 700,
100
+ 'letter-spacing': -2,
101
+ 'font-family': var(--ff-display, $displayfont),
102
+ ),
103
+ ),
104
+
105
+ 'h-xl': (('break': false,
106
+ 'responsive': false,
107
+ 'font-size': 36,
108
+ 'line-height': 1.2222222222,
109
+ 'font-weight': 700,
110
+ 'letter-spacing': -2,
111
+ 'font-family': var(--ff-display, $displayfont),
112
+ ),
113
+ ),
114
+
115
+ 'h-xxl': (('break': false,
116
+ 'responsive': false,
117
+ 'font-size': 40,
118
+ 'line-height': 1.2,
119
+ 'font-weight': 700,
120
+ 'letter-spacing': -2,
121
+ 'font-family': var(--ff-display, $displayfont),
122
+ ),
123
+ ),
124
+
125
+ 'd-xs': (('break': false,
126
+ 'responsive': false,
127
+ 'font-size': 44,
128
+ 'line-height': 1.18,
129
+ 'font-weight': 700,
130
+ 'letter-spacing': -2,
131
+ 'font-family': var(--ff-display, $displayfont),
132
+ ),
133
+ ),
134
+
135
+ 'd-s': (('break': false,
136
+ 'responsive': false,
137
+ 'font-size': 48,
138
+ 'line-height': 1.1666,
139
+ 'font-weight': 700,
140
+ 'letter-spacing': -2,
141
+ 'font-family': var(--ff-display, $displayfont),
142
+ ),
143
+ ),
144
+
145
+ 'd-m': (('break': false,
146
+ 'responsive': false,
147
+ 'font-size': 52,
148
+ 'line-height': 1.15,
149
+ 'font-weight': 700,
150
+ 'letter-spacing': -2,
151
+ 'font-family': var(--ff-display, $displayfont),
152
+ ),
153
+ ),
154
+
155
+ 'd-l': (('break': false,
156
+ 'responsive': false,
157
+ 'font-size': 56,
158
+ 'line-height': 1.14,
159
+ 'font-weight': 700,
160
+ 'letter-spacing': -2,
161
+ 'font-family': var(--ff-display, $displayfont),
162
+ ),
163
+ ),
164
+
165
+ 'd-xl': (('break': false,
166
+ 'responsive': false,
167
+ 'font-size': 60,
168
+ 'line-height': 1.133,
169
+ 'font-weight': 700,
170
+ 'letter-spacing': -2,
171
+ 'font-family': var(--ff-display, $displayfont),
172
+ ),
173
+ ),
174
+
175
+ ) !default;