@kirbydesign/designsystem 5.0.10 → 5.0.14

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.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@kirbydesign/designsystem",
3
- "version": "5.0.10",
3
+ "version": "5.0.14",
4
4
  "dependencies": {
5
5
  "chart.js": "3.3.2",
6
6
  "chartjs-adapter-date-fns": "^2.0.0",
7
7
  "chartjs-plugin-annotation": "^1.0.2",
8
8
  "chartjs-plugin-datalabels": "^2.0.0",
9
9
  "@ionic/angular": "5.5.2",
10
- "@kirbydesign/core": "0.0.17",
10
+ "@kirbydesign/core": "0.0.20",
11
11
  "date-fns": "2.21.1",
12
12
  "date-fns-tz": "1.1.4",
13
13
  "highcharts": "8.0.4",
@@ -1,269 +1 @@
1
- @use "sass:map";
2
- @use "sass:math";
3
- @use 'utils';
4
- @use 'base/ionic';
5
- @use 'base/typography';
6
- @use 'base/line-clamp';
7
- @use 'base/list';
8
-
9
- :root {
10
- --when-merging-pull-request: 'should run publish workflow';
11
- }
12
-
13
- :root,
14
- :host {
15
- --kirby-font-family: 'Roboto';
16
- font-family: var(--kirby-font-family);
17
- @each $color, $color-name in utils.$kirby-colors {
18
- --kirby-#{$color}: #{$color-name};
19
- }
20
- @each $color, $color-name in utils.$text-colors {
21
- --kirby-text-color-#{$color}: #{$color-name};
22
- }
23
- --kirby-page-max-width: 1366px;
24
- --kirby-statusbar-padding: var(--ion-statusbar-padding);
25
- --kirby-safe-area-top: var(--ion-safe-area-top);
26
- --kirby-safe-area-right: var(--ion-safe-area-right);
27
- --kirby-safe-area-bottom: var(--ion-safe-area-bottom);
28
- --kirby-safe-area-left: var(--ion-safe-area-left);
29
- --kirby-tab-bar-height: 50px;
30
-
31
- // Prevent iOS tap highlight:
32
- -webkit-tap-highlight-color: transparent;
33
- }
34
-
35
- @function get-drawer-additional-padding-top() {
36
- $modal-close-button-inner-height: utils.size('l'); // Todo: Move to / get from shared var
37
- $modal-close-button-vertical-margin: utils.size('xxxs') * 2; // Todo: Move to / get from shared var
38
- $modal-header-vertical-padding: 3px * 2; // 3px defined by Ionic
39
- $modal-header-total-height: $modal-close-button-inner-height + $modal-close-button-vertical-margin +
40
- $modal-header-vertical-padding;
41
- $modal-header-vertical-center: math.round($modal-header-total-height * 0.5);
42
- @return $modal-header-vertical-center;
43
- }
44
-
45
- $backdrop-opacity: 0.4;
46
-
47
- body.allow-background-scroll {
48
- overflow: initial !important;
49
- }
50
-
51
- ion-modal.kirby-overlay {
52
- position: fixed;
53
-
54
- // Ensure consistent backdrop on all overlays:
55
- &:not(.modal-card) {
56
- --backdrop-opacity: #{$backdrop-opacity};
57
- ion-backdrop {
58
- opacity: var(--backdrop-opacity);
59
- }
60
- }
61
-
62
- // Ensure consistent backdrop on card style modals, as Ionic 5 only applies --backdrop-opacity to :first-of-type:
63
- // See https://github.com/ionic-team/ionic/commit/253cd96164914a803f6bb42ff95ca74880c940d0
64
- // and https://github.com/ionic-team/ionic/issues/20800#issuecomment-606670762
65
- &.modal-card,
66
- &.modal-card:first-of-type {
67
- --backdrop-opacity: #{$backdrop-opacity};
68
- }
69
-
70
- .modal-shadow {
71
- display: none;
72
- }
73
-
74
- &.kirby-modal {
75
- box-sizing: border-box;
76
- --background: var(--kirby-modal-background, #{utils.get-color('background-color')});
77
- --border-radius: 0;
78
- --height: auto;
79
-
80
- &.kirby-modal-compact {
81
- --border-radius: #{utils.$border-radius};
82
- --max-width: #{utils.$compact-modal-max-width};
83
- text-align: center;
84
- }
85
-
86
- &.kirby-drawer {
87
- --min-height: #{utils.$drawer-default-height};
88
- --kirby-modal-padding-top: calc(var(--kirby-safe-area-top, 0px) + #{utils.size('m')});
89
- padding-top: var(--kirby-modal-padding-top);
90
- align-items: flex-end;
91
-
92
- &.interact-with-background {
93
- &.kirby-modal.kirby-drawer {
94
- --kirby-modal-padding-top: 0px;
95
- }
96
- }
97
-
98
- .modal-wrapper {
99
- border-top-left-radius: #{utils.$border-radius};
100
- border-top-right-radius: #{utils.$border-radius};
101
- }
102
- }
103
-
104
- @include utils.media('<medium') {
105
- &:not(.kirby-drawer):not(.kirby-modal-compact) {
106
- --height: 100%;
107
- }
108
- }
109
-
110
- &:not(.kirby-modal-compact).kirby-modal-full-height {
111
- --height: 100%;
112
- }
113
-
114
- &.modal-card:not(.kirby-drawer) {
115
- .modal-wrapper {
116
- @include utils.media('<medium') {
117
- // Reset Ionic Card style height + top border radius:
118
- --height: 100%;
119
- border-top-left-radius: 0;
120
- border-top-right-radius: 0;
121
- }
122
-
123
- @include utils.media('>=medium') {
124
- // Reset Ionic Card style border radius:
125
- border-radius: utils.$border-radius;
126
- }
127
- }
128
- }
129
-
130
- @include utils.media('>=medium') {
131
- --width: #{utils.$modal-max-width};
132
- --border-radius: #{utils.$border-radius};
133
- --box-shadow: #{utils.get-elevation(8)};
134
-
135
- &:not(.kirby-modal-compact) {
136
- --max-height: 100%;
137
- --kirby-modal-padding-top-base: #{utils.size('xl')};
138
- --kirby-modal-padding-top: var(--kirby-modal-padding-top-base);
139
- padding-top: var(--kirby-modal-padding-top);
140
-
141
- &:not(.kirby-drawer) {
142
- --min-height: #{utils.$modal-default-height};
143
- align-items: flex-start;
144
-
145
- &.kirby-modal-small {
146
- --min-height: #{map.get(utils.$modal-heights, 's')};
147
- }
148
- &.kirby-modal-medium {
149
- --min-height: #{map.get(utils.$modal-heights, 'm')};
150
- }
151
- &.kirby-modal-large {
152
- --min-height: #{map.get(utils.$modal-heights, 'l')};
153
- }
154
-
155
- &.kirby-modal-full-height .modal-wrapper,
156
- .modal-wrapper.full-height {
157
- border-bottom-left-radius: 0;
158
- border-bottom-right-radius: 0;
159
- }
160
- }
161
- }
162
-
163
- &.kirby-drawer {
164
- --kirby-modal-padding-top: calc(
165
- var(--kirby-modal-padding-top-base) + #{get-drawer-additional-padding-top()}
166
- );
167
-
168
- .modal-wrapper {
169
- border-bottom-left-radius: 0;
170
- border-bottom-right-radius: 0;
171
- }
172
- }
173
- }
174
- }
175
-
176
- &.kirby-action-sheet {
177
- --background: transparent;
178
- --width: 100%;
179
- --height: 100%;
180
-
181
- .modal-wrapper {
182
- display: flex;
183
- justify-content: center;
184
- align-items: flex-end;
185
- pointer-events: none;
186
- --max-width: auto;
187
- --max-height: auto;
188
- }
189
- }
190
-
191
- &.kirby-alert {
192
- --background: #{utils.get-color('background-color')};
193
- --border-radius: #{utils.$border-radius};
194
- --box-shadow: #{utils.get-elevation(8)};
195
-
196
- .modal-wrapper {
197
- max-width: utils.$alert-max-width;
198
- height: auto;
199
- text-align: center;
200
- }
201
- }
202
- }
203
-
204
- ion-loading.kirby-loading-overlay {
205
- --backdrop-opacity: #{utils.$loading-overlay-backdrop-opacity};
206
- --ion-backdrop-color: #{utils.get-color('background-color')};
207
- .loading-wrapper {
208
- --background: transparent;
209
- }
210
- }
211
-
212
- .kirby-toast {
213
- position: fixed;
214
- user-select: none;
215
- text-align: center;
216
-
217
- // Set default colors
218
- --background: #{utils.get-color('success')};
219
- --color: #{utils.get-color('success-contrast')};
220
- --button-color: #{utils.get-color('success-contrast')};
221
-
222
- @each $color-name, $color-value in utils.$notification-colors {
223
- &.#{$color-name} {
224
- --background: #{utils.get-color($color-name)};
225
- --color: #{utils.get-color($color-name + '-contrast')};
226
- --button-color: #{utils.get-color($color-name + '-contrast')};
227
- }
228
- }
229
- }
230
-
231
- /*
232
- * FAB-sheet backdrop
233
- */
234
- .fab-sheet-active {
235
- .tabs-inner,
236
- ion-router-outlet,
237
- .ion-page {
238
- overflow: visible;
239
- contain: none !important;
240
- }
241
-
242
- ion-tab-bar {
243
- z-index: -1;
244
- }
245
- }
246
-
247
- /*
248
- * Link-styles (anchor tag with href)
249
- */
250
- :link,
251
- :visited {
252
- color: inherit;
253
- cursor: pointer;
254
- text-decoration: underline;
255
- }
256
-
257
- /*
258
- * Class to add link-icon to the right of e.g. anchor tag.
259
- */
260
- .kirby-external-icon {
261
- $icon-scaling-factor: 1.5em;
262
- white-space: nowrap;
263
- background-image: url('/assets/kirby/icons/svg/link.svg');
264
- background-repeat: no-repeat;
265
- background-position: right 50%;
266
- background-size: $icon-scaling-factor;
267
- //place icon to the right of text, with icons own width + the actual spacing
268
- padding-right: calc(#{$icon-scaling-factor} + #{utils.size('xxxs')});
269
- }
1
+ @forward "~@kirbydesign/core/scss/global-styles";
package/scss/_utils.scss CHANGED
@@ -1 +1 @@
1
- @forward '~@kirbydesign/core/scss/utils';
1
+ @forward "~@kirbydesign/core/scss/utils";
@@ -1,188 +1 @@
1
- @use "sass:list";
2
- @use "sass:map";
3
- @use "sass:math";
4
- @use "sass:string";
5
- @use "../themes/colors";
6
- @use "variables";
7
-
8
- @function _get-map-prop($map, $key) {
9
- @if map.has-key($map, $key) {
10
- @return map.get($map, $key);
11
- }
12
-
13
- @error 'Unknown key `#{$key}`.';
14
- @return null;
15
- }
16
-
17
- @function size($key: 'm') {
18
- $negative: string.index($key, '-') == 1;
19
- @if ($negative) {
20
- $key: string.slice($key, 2, -1);
21
- }
22
- $value: _get-map-prop(variables.$sizes, $key);
23
- @return if($negative, string.unquote('-' + $value), $value);
24
- }
25
-
26
- @function z($key) {
27
- @return _get-map-prop(variables.$z-layers, $key);
28
- }
29
-
30
- @function font-size($key: 'n') {
31
- @if ($key == 'display') {
32
- @warn 'Display key is deprecated';
33
- }
34
- @return _get-map-prop(variables.$font-sizes, $key);
35
- }
36
-
37
- @function line-height($key: 'm') {
38
- @return _get-map-prop(variables.$line-height, $key);
39
- }
40
-
41
- @function font-weight($key: 'normal') {
42
- @return _get-map-prop(variables.$font-weight, $key);
43
- }
44
-
45
- @function icon-font-size($size) {
46
- @return map.get(variables.$icon-font-sizes, $size);
47
- }
48
-
49
- @function get-color($variant, $getValueOnly: false, $map: colors.$kirby-colors) {
50
- $value: _get-map-prop($map, $variant);
51
- @if $getValueOnly == true {
52
- @return $value;
53
- } @else {
54
- @return string.unquote('var(--kirby-' + $variant + ')');
55
- }
56
- }
57
-
58
- @function get-text-color($variant) {
59
- $value: _get-map-prop(colors.$text-colors, $variant);
60
- @return string.unquote('var(--kirby-text-color-' + $variant + ')');
61
- }
62
-
63
- @function get-elevation($value) {
64
- @return map.get(variables.$elevations, $value);
65
- }
66
-
67
- @function get-transition-duration($value) {
68
- @return map.get(variables.$transition-durations, $value);
69
- }
70
-
71
- @function get-transition-easing($value) {
72
- @return map.get(variables.$transition-easings, $value);
73
- }
74
-
75
- @function get-shadow-size($elevation) {
76
- $shadow-size: 0;
77
- $shadow-list: map.get(variables.$elevations, $elevation);
78
- @each $shadow in $shadow-list {
79
- $offset-x: math.abs(_get-shadow-value($shadow, 'offset-x'));
80
- $offset-y: math.abs(_get-shadow-value($shadow, 'offset-y'));
81
- $blur-radius: _get-shadow-value($shadow, 'blur-radius');
82
- $spread-radius: _get-shadow-value($shadow, 'spread-radius');
83
- $current-shadow-size: math.max($offset-x, $offset-y) + $blur-radius + $spread-radius;
84
- $shadow-size: math.max($shadow-size, $current-shadow-size);
85
- }
86
- @return $shadow-size;
87
- }
88
-
89
- @function _get-shadow-value($shadow, $valuekey) {
90
- $shadow-value-map: (
91
- 'offset-x': 1,
92
- 'offset-y': 2,
93
- 'blur-radius': 3,
94
- 'spread-radius': 4,
95
- );
96
- $value-index: map.get($shadow-value-map, $valuekey);
97
- @return list.nth($shadow, $value-index);
98
- }
99
-
100
- /**
101
- * Outputs all keys from map as CSS class selector list
102
- */
103
- @function keys-to-classes($map) {
104
- $classes: ();
105
- @each $key in map.keys($map) {
106
- $classes: list.append($classes, '.#{$key}', $separator: comma);
107
- }
108
- @return $classes;
109
- }
110
-
111
- @mixin slotted($selectors...) {
112
- ::ng-deep > {
113
- #{$selectors} {
114
- @content;
115
- }
116
- }
117
- }
118
-
119
- @mixin theme-background($variant, $text-variant-override: null) {
120
- $background-color: null;
121
- $text-color: null;
122
- @if $variant == transparent {
123
- $background-color: transparent;
124
- $text-color: get-text-color('black');
125
- } @else {
126
- $background-color: get-color($variant);
127
- $text-color: get-color($variant + '-contrast');
128
- }
129
- @if ($text-variant-override != null) {
130
- $text-color: get-text-color($text-variant-override);
131
- }
132
- background-color: $background-color;
133
- color: $text-color;
134
- }
135
-
136
- /// Only apply the :hover selector and styles if pointer device can hover
137
- /// (effectively desktop/mouse devices):
138
- @mixin hover() {
139
- @media (hover: hover) {
140
- &:hover {
141
- @content;
142
- }
143
- }
144
- }
145
-
146
- // Only apply the :focus selector and styles if pointer device can hover
147
- // (effectively desktop/mouse devices):
148
- @mixin focus() {
149
- @media (hover: hover) {
150
- &:focus {
151
- @content;
152
- }
153
- }
154
- }
155
-
156
- // Only apply the styles on touch devices
157
- // No check for `hover: none`, as Samsung Galaxy will return false on `hover: none` media query
158
- @mixin touch() {
159
- @media (pointer: coarse) {
160
- @content;
161
- }
162
- }
163
-
164
- // Only apply the styles on non touch devices
165
- // (fine pointer and hover):
166
- @mixin not-touch() {
167
- @media (hover: hover) and (pointer: fine) {
168
- @content;
169
- }
170
- }
171
-
172
- // Ensure minimum click area (default 44 x 44 px)
173
- // Ignore rounded corners to ensure square click area
174
- @mixin accessible-target-size($width: variables.$fat-finger-size, $height: $width) {
175
- position: relative;
176
-
177
- &::after {
178
- content: '';
179
- position: absolute;
180
- min-height: $height;
181
- min-width: $width;
182
- width: 100%;
183
- height: 100%;
184
- transform: translate(-50%, -50%);
185
- left: 50%;
186
- top: 50%;
187
- }
188
- }
1
+ @forward "~@kirbydesign/core/scss/base/functions";
@@ -1,36 +1 @@
1
- @use '../base/functions';
2
- @use '../themes/colors';
3
-
4
- /* Core CSS required for Ionic components to work properly */
5
- @import '~@ionic/angular/css/core.css';
6
-
7
- @mixin ionic-color-map($ionic-variant, $kirby-variant: $ionic-variant) {
8
- --ion-color-#{$ionic-variant}: var(--kirby-#{$kirby-variant});
9
- --ion-color-#{$ionic-variant}-rgb: #{functions.get-color(
10
- #{$kirby-variant}-rgb,
11
- true,
12
- colors.$kirby-colors
13
- )};
14
- --ion-color-#{$ionic-variant}-contrast: var(--kirby-#{$kirby-variant}-contrast);
15
- --ion-color-#{$ionic-variant}-contrast-rgb: #{functions.get-color(
16
- #{$kirby-variant}-contrast-rgb,
17
- true,
18
- colors.$kirby-colors
19
- )};
20
- --ion-color-#{$ionic-variant}-shade: var(--kirby-#{$kirby-variant}-shade);
21
- --ion-color-#{$ionic-variant}-tint: var(--kirby-#{$kirby-variant}-tint);
22
- }
23
-
24
- :root {
25
- @include ionic-color-map('primary');
26
- @include ionic-color-map('secondary');
27
- @include ionic-color-map('tertiary');
28
- @include ionic-color-map('success');
29
- @include ionic-color-map('warning');
30
- @include ionic-color-map('danger');
31
- @include ionic-color-map('light');
32
- @include ionic-color-map('medium');
33
- @include ionic-color-map('dark');
34
-
35
- --ion-font-family: var(--kirby-font-family);
36
- }
1
+ @forward "~@kirbydesign/core/scss/base/ionic";
@@ -1,56 +1 @@
1
- .kirby-line-clamp {
2
- // Needed both for line-clamp support and for fallback solution
3
- overflow: hidden;
4
-
5
- // Fallback solution with "explicit ellipsis"
6
- // line-height value is expected to be in px unit
7
-
8
- line-height: var(--line-height);
9
- max-height: calc(var(--line-clamp) * var(--line-height));
10
- position: relative;
11
-
12
- // Ellipsis
13
- &::before {
14
- content: '…';
15
- position: absolute;
16
- right: 0;
17
- bottom: 0;
18
- background-color: var(--kirby-background-color);
19
- line-height: var(--line-height);
20
- height: var(--line-height);
21
- }
22
-
23
- // Cover ellipsis when number of lines is less than or equal to line-clamp value
24
- &::after {
25
- content: '';
26
- position: absolute;
27
- right: 0;
28
- width: 1em;
29
- height: var(--line-height);
30
- line-height: var(--line-height);
31
- background-color: var(--kirby-background-color);
32
- }
33
- }
34
-
35
- // Non-standard line-clamp solution with wide browser support
36
- // See https://caniuse.com/mdn-css_properties_-webkit-line-clamp
37
- @supports (-webkit-line-clamp: 1) {
38
- .kirby-line-clamp {
39
- display: -webkit-box;
40
- -webkit-line-clamp: var(--line-clamp, none);
41
- -webkit-box-orient: vertical;
42
-
43
- // Work around weird bug by setting visibility
44
- // See https://bugs.webkit.org/show_bug.cgi?id=207013
45
- // and https://stackoverflow.com/questions/41995229/webkit-line-clamp-does-not-work-on-chrome-unless-i-make-some-unrelated-css-chan
46
- visibility: visible;
47
-
48
- // Reset fallback properties that are not needed when support for line-clamp
49
- max-height: initial;
50
- position: initial;
51
- &::before,
52
- &::after {
53
- display: none;
54
- }
55
- }
56
- }
1
+ @forward "~@kirbydesign/core/scss/base/line-clamp";
@@ -1,11 +1 @@
1
- ul,
2
- ol {
3
- margin-inline-start: 0.25em;
4
- padding-inline-start: 1em;
5
- line-height: 1.5;
6
- }
7
-
8
- li li,
9
- li + li {
10
- margin-block-start: 0.5em;
11
- }
1
+ @forward "~@kirbydesign/core/scss/base/list";
@@ -1,105 +1 @@
1
- @use "functions";
2
-
3
- @import '~@fontsource/roboto/300.css';
4
- @import '~@fontsource/roboto/400.css';
5
- @import '~@fontsource/roboto/700.css';
6
- @import '~@fontsource/roboto/900.css';
7
-
8
- h1,
9
- .h1,
10
- h2,
11
- .h2,
12
- h3,
13
- .h3,
14
- h4,
15
- .h4,
16
- p,
17
- .p {
18
- margin: 0;
19
- margin-bottom: functions.size('s');
20
- }
21
-
22
- kirby-app .page-title {
23
- > h1,
24
- h2,
25
- h3,
26
- h4,
27
- h5,
28
- h6 {
29
- margin: 0;
30
- }
31
- }
32
-
33
- .kirby-text-display-1 {
34
- font-size: functions.font-size('xxxxl');
35
- font-weight: functions.font-weight('black');
36
- line-height: normal;
37
- }
38
-
39
- .kirby-text-display-2 {
40
- font-size: functions.font-size('xxxl');
41
- font-weight: functions.font-weight('black');
42
- line-height: normal;
43
- }
44
-
45
- .kirby-text-display-3 {
46
- font-size: functions.font-size('xxl');
47
- font-weight: functions.font-weight('black');
48
- line-height: normal;
49
- }
50
-
51
- h1,
52
- .h1,
53
- .kirby-text-xlarge {
54
- font-size: functions.font-size('xl');
55
- font-weight: functions.font-weight('black');
56
- line-height: functions.line-height('xl');
57
- }
58
-
59
- h2,
60
- .h2,
61
- .kirby-text-large {
62
- font-size: functions.font-size('l');
63
- font-weight: functions.font-weight('bold');
64
- line-height: functions.line-height('l');
65
- }
66
-
67
- h3,
68
- .h3,
69
- .kirby-text-medium {
70
- font-size: functions.font-size('m');
71
- font-weight: functions.font-weight('bold');
72
- line-height: functions.line-height('m');
73
- }
74
-
75
- p,
76
- .p,
77
- .kirby-text-normal {
78
- font-size: functions.font-size('n');
79
- line-height: functions.line-height('n');
80
- }
81
-
82
- .kirby-text-small {
83
- font-size: functions.font-size('s');
84
- line-height: functions.line-height('s');
85
- }
86
-
87
- .kirby-text-small-light {
88
- font-size: functions.font-size('s');
89
- font-weight: functions.font-weight('light');
90
- line-height: functions.line-height('s');
91
- }
92
-
93
- .kirby-text-xsmall {
94
- font-size: functions.font-size('xs');
95
- line-height: functions.line-height('xs');
96
- }
97
-
98
- .kirby-text-xxsmall {
99
- font-size: functions.font-size('xxs');
100
- line-height: functions.line-height('xxs');
101
- }
102
-
103
- .kirby-text-bold {
104
- font-weight: functions.font-weight('bold');
105
- }
1
+ @forward "~@kirbydesign/core/scss/base/typography";
@@ -1,197 +1 @@
1
- @use "sass:map";
2
- @use "sass:math";
3
- /*
4
- SPACINGS
5
- ****************************************************************************/
6
- $sizes: (
7
- xxxl: 56px,
8
- xxl: 48px,
9
- xl: 40px,
10
- l: 32px,
11
- m: 24px,
12
- s: 16px,
13
- xs: 12px,
14
- xxs: 8px,
15
- xxxs: 4px,
16
- xxxxs: 2px,
17
- ) !default;
18
-
19
- /*
20
- FONT SETTINGS
21
- ****************************************************************************/
22
- $font-sizes: (
23
- xxxxl: 72px,
24
- xxxl: 56px,
25
- xxl: 40px,
26
- xl: 32px,
27
- l: 22px,
28
- m: 18px,
29
- n: 16px,
30
- s: 14px,
31
- xs: 12px,
32
- xxs: 10px,
33
- ) !default;
34
-
35
- $line-height: (
36
- // h1:
37
- xl: 38px,
38
- // h2:
39
- l: 28px,
40
- // h3:
41
- m: 24px,
42
- // p - please note: p and h3 share the same line-height, added the sizes to "match" with font-size:
43
- n: 24px,
44
- // text-small:
45
- s: 20px,
46
- // text-xsmall:
47
- xs: 16px,
48
- // text-xxsmall:
49
- xxs: 11px
50
- ) !default;
51
-
52
- $font-weight: (
53
- light: 300,
54
- normal: 400,
55
- bold: 700,
56
- // black will be treated as a named css color if not quoted
57
- 'black': 900,
58
- ) !default;
59
-
60
- /* Icon
61
- ****************************************************************************/
62
- $icon-font-sizes: (
63
- 'xs': map.get($sizes, 's'),
64
- 'sm': map.get($sizes, 'm'),
65
- 'md': map.get($sizes, 'l'),
66
- 'lg': map.get($sizes, 'xxxl'),
67
- ) !default;
68
-
69
- /*
70
- Z - Index overview
71
- ****************************************************************************/
72
- $z-layers: (
73
- default: 1,
74
- segmentBadge: 2,
75
- avatarBadge: 2,
76
- dropdown: 800,
77
- popover: 850,
78
- modal-overlay: 900,
79
- modal: 901,
80
- loading-overlay: 1001,
81
- ) !default;
82
-
83
- $border-radius: 16px !default;
84
- $border-radius-round: 999px !default;
85
-
86
- /* Breakpoints
87
- ****************************************************************************/
88
- $breakpoints: (
89
- small: 321px,
90
- medium: 721px,
91
- large: 1025px,
92
- xlarge: 60em,
93
- xxlarge: 80em,
94
- ) !default;
95
-
96
- /* Elevation
97
- ****************************************************************************/
98
- $elevations: (
99
- 2: (
100
- 0 5px 10px -10px rgba(28, 28, 28, 0.3),
101
- 0 0 5px 0 rgba(28, 28, 28, 0.08),
102
- ),
103
- 4: (
104
- 0 10px 15px -10px rgba(28, 28, 28, 0.3),
105
- 0 0 5px 0 rgba(28, 28, 28, 0.08),
106
- ),
107
- 8: (
108
- 0 20px 30px -15px rgba(28, 28, 28, 0.3),
109
- 0 0 5px 0 rgba(28, 28, 28, 0.08),
110
- ),
111
- ) !default;
112
-
113
- /* avatar
114
- ****************************************************************************/
115
- $avatar-sizes: (
116
- xs: 32px,
117
- s: 40px,
118
- m: 56px,
119
- l: 96px,
120
- ) !default;
121
-
122
- $avatar-badge-size: 16px;
123
-
124
- /* Page
125
- ****************************************************************************/
126
- $page-content-max-width: 720px;
127
-
128
- /* Modal
129
- ****************************************************************************/
130
- $alert-max-width: 359px;
131
- $compact-modal-max-width: 359px;
132
- $modal-max-width: 720px;
133
-
134
- $modal-heights: (
135
- s: math.floor($modal-max-width * 0.4),
136
- m: math.floor($modal-max-width * 0.64),
137
- l: math.floor($modal-max-width * 0.8),
138
- ) !default;
139
-
140
- $modal-default-height: map.get($modal-heights, 'm');
141
- $drawer-default-height: map.get($modal-heights, 's');
142
-
143
- /* Item
144
- ****************************************************************************/
145
- $item-heights: (
146
- m: 56px,
147
- s: 44px,
148
- xs: 32px,
149
- ) !default;
150
-
151
- /* Dropdown
152
- ****************************************************************************/
153
- $dropdown-item-height: map.get($item-heights, 's');
154
-
155
- /* Button, Checkbox, Page, Radio
156
- ****************************************************************************/
157
- $fat-finger-size: 44px;
158
-
159
- /* Checkbox, Radio
160
- ****************************************************************************/
161
- $checkbox-radio-sizes: (
162
- 'xs': map.get($sizes, 'l'),
163
- 'sm': $fat-finger-size,
164
- 'md': map.get($sizes, 'xxxl'),
165
- );
166
-
167
- $checkbox-radio-spacing: (
168
- 'to-edge': map.get($sizes, 's'),
169
- 'to-label': map.get($sizes, 'xs'),
170
- );
171
-
172
- /* Transitions
173
- ****************************************************************************/
174
- $soft-keyboard-transition-enter: 250ms ease-out 1ms; // Adding a 1ms delay seems to improve the smoothness on iPhone
175
- $soft-keyboard-transition-leave: 150ms ease-out;
176
-
177
- $transition-durations: (
178
- quick: 200ms,
179
- short: 300ms,
180
- long: 500ms,
181
- extra-long: 1000ms,
182
- );
183
-
184
- // Easing function
185
- $transition-easings: (
186
- static: linear,
187
- enter: ease-out,
188
- exit: ease-in,
189
- enter-exit: ease,
190
- motion: cubic-bezier(0.25, 0.1, 0.25, 1),
191
- modal: (
192
- enter: cubic-bezier(0.32, 0.72, 0, 1),
193
- exit: cubic-bezier(0.32, 0.72, 0, 1),
194
- ),
195
- );
196
-
197
- $loading-overlay-backdrop-opacity: 0.8;
1
+ @forward "~@kirbydesign/core/scss/base/variables";
@@ -1,3 +1 @@
1
- @forward 'generic';
2
- @forward 'elements';
3
- @forward 'components';
1
+ @forward "~@kirbydesign/core/scss/print";
@@ -1,7 +1 @@
1
- @forward 'kirby-app';
2
- @forward 'kirby-fab-sheet';
3
- @forward 'kirby-list';
4
- @forward 'kirby-modal-wrapper';
5
- @forward 'kirby-page';
6
- @forward 'kirby-router-outlet';
7
- @forward 'kirby-tab-bar';
1
+ @forward "~@kirbydesign/core/scss/print/components";
@@ -1,21 +1 @@
1
- @media print {
2
- kirby-app {
3
- // Part of making sure you can print more than a single page
4
- display: contents !important;
5
-
6
- // Part of making sure you can print more than a single page
7
- ion-app {
8
- display: contents !important;
9
- }
10
-
11
- // Part of making sure you can print more than a single page
12
- .ion-page {
13
- display: contents !important;
14
- }
15
-
16
- // Only print the currently displayed ion-page
17
- .ion-page-hidden {
18
- display: none !important;
19
- }
20
- }
21
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-app";
@@ -1,5 +1 @@
1
- @media print {
2
- kirby-fab-sheet {
3
- display: none !important;
4
- }
5
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-fab-sheet";
@@ -1,24 +1 @@
1
- @media print {
2
- ion-item-group {
3
- margin-block: 17pt !important;
4
- }
5
-
6
- ion-item {
7
- --min-height: none !important;
8
- --padding-top: 0 !important;
9
- --padding-bottom: 0 !important;
10
- --inner-padding-top: 0 !important;
11
- --inner-padding-bottom: 0 !important;
12
- --inner-padding-end: 0 !important;
13
- }
14
-
15
- ion-item::part(native),
16
- ion-item-divider {
17
- padding-inline-start: initial !important;
18
- padding-inline-end: initial !important;
19
- }
20
-
21
- [ng-reflect-use-virtual-scroll='true'] .viewport {
22
- height: auto !important;
23
- }
24
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-list";
@@ -1,16 +1 @@
1
- @media print {
2
- kirby-modal-wrapper {
3
- // Part of making sure you can print more than a single page
4
- display: contents !important;
5
-
6
- ion-content::part(background) {
7
- display: none !important;
8
- }
9
-
10
- // Part of making sure you can print more than a single page
11
- .inner-scroll,
12
- ion-content::part(scroll) {
13
- display: contents !important;
14
- }
15
- }
16
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-modal-wrapper";
@@ -1,17 +1 @@
1
- @media print {
2
- kirby-page-actions {
3
- display: none !important;
4
- }
5
-
6
- ion-header {
7
- display: none !important;
8
- }
9
-
10
- ion-content {
11
- padding: initial !important;
12
- }
13
-
14
- .page-title {
15
- margin: initial !important;
16
- }
17
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-page";
@@ -1,11 +1 @@
1
- @media print {
2
- kirby-router-outlet {
3
- // Part of making sure you can print more than a single page
4
- display: contents !important;
5
-
6
- // Part of making sure you can print more than a single page
7
- ion-router-outlet {
8
- display: contents !important;
9
- }
10
- }
11
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-router-outlet";
@@ -1,25 +1 @@
1
- @media print {
2
- kirby-tab-bar {
3
- // Part of making sure you can print more than a single page
4
- display: contents !important;
5
-
6
- // Part of making sure you can print more than a single page
7
- ion-tabs {
8
- display: contents !important;
9
- }
10
-
11
- ion-tab-bar {
12
- display: none !important;
13
- }
14
-
15
- ion-content::part(background) {
16
- display: none !important;
17
- }
18
-
19
- // Part of making sure you can print more than a single page
20
- .inner-scroll,
21
- ion-content::part(scroll) {
22
- display: contents !important;
23
- }
24
- }
25
- }
1
+ @forward "~@kirbydesign/core/scss/print/components/kirby-tab-bar";
@@ -1,6 +1 @@
1
- @media print {
2
- // Buttons do not make much sense on print, but this may be too far reaching
3
- button {
4
- display: none !important;
5
- }
6
- }
1
+ @forward "~@kirbydesign/core/scss/print/elements/button";
@@ -1,3 +1 @@
1
- @forward 'button';
2
- @forward 'page';
3
- @forward 'preformatted-text';
1
+ @forward "~@kirbydesign/core/scss/print/elements";
@@ -1,6 +1 @@
1
- @media print {
2
- html,
3
- body {
4
- height: auto !important;
5
- }
6
- }
1
+ @forward "~@kirbydesign/core/scss/print/elements/page";
@@ -1,6 +1 @@
1
- @media print {
2
- pre {
3
- width: max-content !important;
4
- margin: auto !important;
5
- }
6
- }
1
+ @forward "~@kirbydesign/core/scss/print/elements/preformatted-text";
@@ -1,9 +1 @@
1
- @media print {
2
- *,
3
- ::after,
4
- ::after {
5
- color: #000 !important;
6
- background-color: transparent !important;
7
- --background: transparent !important;
8
- }
9
- }
1
+ @forward "~@kirbydesign/core/scss/print/generic/colors";
@@ -1,4 +1 @@
1
- @forward 'colors';
2
- @forward 'page';
3
- @forward 'reset';
4
- @forward 'typography';
1
+ @forward "~@kirbydesign/core/scss/print/generic";
@@ -1,40 +1 @@
1
- // Generic base print styles
2
- @media print {
3
- @page {
4
- margin: 2.54cm;
5
- orphans: 4;
6
- widows: 3;
7
- }
8
-
9
- h1,
10
- h2,
11
- h3,
12
- h4,
13
- h5,
14
- h6 {
15
- break-after: avoid;
16
- }
17
-
18
- blockquote,
19
- figure,
20
- h1,
21
- h2,
22
- h3,
23
- h4,
24
- h5,
25
- h6,
26
- img,
27
- ol,
28
- p,
29
- table,
30
- ul,
31
- ion-item-group {
32
- break-inside: avoid;
33
- }
34
- }
35
-
36
- @media print {
37
- :root {
38
- --kirby-page-max-width: 100%;
39
- }
40
- }
1
+ @forward "~@kirbydesign/core/scss/print/generic/page";
@@ -1,12 +1 @@
1
- // Generic reset
2
- // This targets *all* elements so be careful which declarations are made
3
- @media print {
4
- *,
5
- *::before,
6
- *::after {
7
- box-shadow: none !important;
8
- max-width: none !important;
9
- border-radius: 0 !important;
10
- contain: initial !important;
11
- }
12
- }
1
+ @forward "~@kirbydesign/core/scss/print/generic/reset";
@@ -1,70 +1 @@
1
- @media print {
2
- :root {
3
- --kirby-font-family: 'Roboto', sans-serif;
4
- --kirby-font-size-xxlarge: 27pt;
5
- --kirby-font-size-xlarge: 22pt;
6
- --kirby-font-size-large: 15pt;
7
- --kirby-font-size-medium: 12pt;
8
- --kirby-font-size-normal: 11pt;
9
- --kirby-font-size-small: 9pt;
10
- --kirby-line-height-base: 1.4;
11
- }
12
-
13
- html {
14
- font-size: var(--kirby-font-size-normal) !important;
15
- line-height: var(--kirby-line-height-base) !important;
16
- }
17
-
18
- // Generic reset
19
- // This targets *all* elements so be careful which declarations are made
20
- *,
21
- *::before,
22
- *::after {
23
- font-size: inherit !important;
24
- }
25
-
26
- pre {
27
- font-size: var(--kirby-font-size-small) !important;
28
- }
29
-
30
- p {
31
- line-height: var(--kirby-line-height-base) !important;
32
- margin-block: 1em !important;
33
- }
34
-
35
- h1,
36
- .h1,
37
- .kirby-text-xlarge {
38
- font-size: var(--kirby-font-size-xlarge) !important;
39
- line-height: initial !important;
40
- margin-block: 1em !important;
41
- }
42
-
43
- h2,
44
- .h2,
45
- .kirby-text-large {
46
- font-size: var(--kirby-font-size-large) !important;
47
- line-height: initial !important;
48
- margin-block: 1em !important;
49
- }
50
-
51
- h3,
52
- .h3,
53
- .kirby-text-medium {
54
- font-size: var(--kirby-font-size-medium) !important;
55
- line-height: initial !important;
56
- margin-block: 1em !important;
57
- }
58
-
59
- .kirby-text-display-3 {
60
- font-size: var(--kirby-font-size-xxlarge) !important;
61
- line-height: initial !important;
62
- margin-block: 1em !important;
63
- }
64
-
65
- h4,
66
- h5,
67
- h6 {
68
- line-height: initial !important;
69
- }
70
- }
1
+ @forward "~@kirbydesign/core/scss/print/generic/typography";
@@ -1,117 +1 @@
1
- @use "sass:color";
2
- @use "sass:map";
3
- $brand-colors: (
4
- 'primary': #00e89a,
5
- 'secondary': #005c3c,
6
- 'tertiary': #01352c,
7
- ) !default;
8
-
9
- $notification-colors: (
10
- 'success': #2cf287,
11
- 'warning': #ffca3a,
12
- 'danger': #ff595e,
13
- );
14
-
15
- $system-colors: (
16
- 'background-color': #f6f6f6,
17
- 'white': #ffffff,
18
- 'light': #f2f2f2,
19
- 'semi-light': #ebebeb,
20
- 'medium': #d1d1d1,
21
- 'semi-dark': #8e8e8e,
22
- 'dark': #353535,
23
- 'black': #1c1c1c,
24
- );
25
-
26
- $text-colors: (
27
- 'white': #ffffff,
28
- 'semi-dark': #707070,
29
- 'black': #1c1c1c,
30
- 'danger': #ee0d0d,
31
- );
32
-
33
- $focus-ring-color: rgb(77, 144, 254);
34
-
35
- @function getAllColors() {
36
- @return map.merge(map.merge($brand-colors, $notification-colors), $system-colors);
37
- }
38
-
39
- $_color-palette: getAllColors();
40
-
41
- // TODO Deprecated variable, used to generate colors in some components - don't use it anymore!
42
- $main-colors: map.remove(
43
- $_color-palette,
44
- 'background-color',
45
- 'black',
46
- 'white',
47
- 'semi-light',
48
- 'semi-dark'
49
- );
50
-
51
- @function _get-color-contrast($color) {
52
- $contrast-light: map.get($system-colors, 'white');
53
- $contrast-dark: map.get($system-colors, 'black');
54
- $color-brightness: _get-color-brightness($color);
55
- @if $color-brightness == 'dark' {
56
- @return $contrast-light;
57
- } @else {
58
- @return $contrast-dark;
59
- }
60
- }
61
-
62
- @function _get-color-brightness($color) {
63
- $red: color.red($color);
64
- $green: color.green($color);
65
- $blue: color.blue($color);
66
- /*
67
- Color brightness is determined by the following formula:
68
- ((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000
69
- */
70
- $color-brightness: (($red * 299) + ($green * 587) + ($blue * 114)) * 0.001;
71
- /* The range for color brightness difference is 125 */
72
- $color-range: 128;
73
-
74
- @if $color-brightness == 255 {
75
- @return 'white';
76
- } @else if $color-brightness >= $color-range {
77
- @return 'light';
78
- } @else {
79
- @return 'dark';
80
- }
81
- }
82
-
83
- @function _get-tint-value($color, $weight: 10) {
84
- @return color.mix(white, $color, $weight);
85
- }
86
-
87
- @function _get-shade-value($color, $weight: 12) {
88
- @return color.mix(black, $color, $weight);
89
- }
90
-
91
- @function _get-rgb-values($color) {
92
- @return color.red($color), color.green($color), color.blue($color);
93
- }
94
-
95
- @function generate-colors($colors: $_color-palette) {
96
- $color-list: ();
97
- @each $color-name, $color-value in $colors {
98
- $color-list: map.merge(
99
- (
100
- $color-name: $color-value,
101
- #{$color-name}-rgb: #{_get-rgb-values($color-value)},
102
- #{$color-name}-contrast: #{_get-color-contrast($color-value)},
103
- #{$color-name}-contrast-rgb: #{_get-rgb-values(_get-color-contrast($color-value))},
104
- #{$color-name}-shade: #{_get-shade-value($color-value)},
105
- #{$color-name}-shade-rgb: #{_get-rgb-values(_get-shade-value($color-value))},
106
- #{$color-name}-tint: #{_get-tint-value($color-value)},
107
- #{$color-name}-tint-rgb: #{_get-rgb-values(_get-tint-value($color-value))},
108
- #{$color-name}-color-brightness: #{_get-color-brightness($color-value)},
109
- ),
110
- $color-list
111
- );
112
- }
113
- @return $color-list;
114
- }
115
-
116
- $kirby-colors: generate-colors();
117
- $kirby-text-colors: generate-colors($text-colors);
1
+ @forward "~@kirbydesign/core/scss/themes/colors";