Skip to content

Commit 5922556

Browse files
authored
#2565 Resolve SASS deprecation warnings for Chelonia dashboard (#2599)
* retire some old default esbuild settings * fix createCID issue * update various sass partials with the latest syntaxes
1 parent a64f8e0 commit 5922556

18 files changed

+53
-36
lines changed

Gruntfile.dashboard.js

-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ module.exports = (grunt) => {
4444
const esbuildOptionsBag = {
4545
default: {
4646
bundle: true,
47-
incremental: true,
4847
loader: {
4948
'.eot': 'file',
5049
'.ttf': 'file',
@@ -57,7 +56,6 @@ module.exports = (grunt) => {
5756
sourcemap: isDevelopment,
5857
format: 'esm',
5958
external: ['*.eot', '*.ttf', '*woff', '*.woff2'],
60-
watch: false,
6159
chunkNames: '[name]-[hash]-cached'
6260
},
6361
mainJS: {

backend/dashboard/assets/style/_base.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "variables" as *;
2+
13
html {
24
background-color: white;
35
min-height: 19rem;

backend/dashboard/assets/style/_colors.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "sass:list";
2+
13
$black: var(--black);
24
$white: var(--white);
35
$text_black: var(--text_black);
@@ -89,7 +91,7 @@ $colors_map: (
8991
// "light-theme" custom-variable declarations
9092
:root {
9193
@each $name, $values in $colors_map {
92-
$light_value: nth($values, 1);
94+
$light_value: list.nth($values, 1);
9395

9496
--#{$name}: #{$light_value};
9597
}
@@ -98,7 +100,7 @@ $colors_map: (
98100
// "dark-theme" custom-variable declarations
99101
:root[data-theme="dark"] {
100102
@each $name, $values in $colors_map {
101-
$dark_value: nth($values, 2);
103+
$dark_value: list.nth($values, 2);
102104

103105
--#{$name}: #{$dark_value};
104106
}

backend/dashboard/assets/style/_icons.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TODO Remove font-awesome and replace by https://icomoon.io font.
1+
@use "sass:map";
22

33
// More fonts icon in node_module/fontawesome
44
$icons: (
@@ -84,7 +84,7 @@ $icons: (
8484
}
8585

8686
@mixin icon($name) {
87-
content: map-get($icons, $name);
87+
content: map.get($icons, $name);
8888
text-rendering: auto;
8989
line-height: 1;
9090
font-family: "Chelonia Icons";

backend/dashboard/assets/style/_layout.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "variables" as *;
2+
13
$toolbarHeight: 2.75rem;
24

35
.app-layout {

backend/dashboard/assets/style/_mixins.scss

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Breakpoints
2+
$gap: 1rem;
3+
$phone_narrow: 441px;
4+
$tablet: 769px;
5+
$desktop: 1200px;
6+
17
@mixin fa($size, $dimensions) {
28
display: inline-block;
39
font-size: $size;

backend/dashboard/assets/style/_transitions.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "_variables";
1+
@use "variables" as *;
22

33
.fade-enter-active,
44
.fade-leave-active {

backend/dashboard/assets/style/_typography.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "variables" as *;
2+
@use "sass:list";
3+
14
@font-face {
25
src: url(../fonts/Inter/Inter_Regular.woff2) format("woff2");
36
font-family: "Inter";
@@ -61,13 +64,13 @@ $lineHeight: 3, 2.25, 1.6875, 1.3125, 1.175, 1;
6164
// From line height: 48px, 36px, 27px, 21px, 16px
6265

6366
@each $size in $titles {
64-
$i: index($titles, $size);
67+
$i: list.index($titles, $size);
6568

6669
.is-title-#{$i} {
6770
font-family: "Poppins";
6871
font-weight: bold;
6972
font-size: $size;
70-
line-height: #{nth($lineHeight, $i)}rem;
73+
line-height: #{list.nth($lineHeight, $i)}rem;
7174
letter-spacing: 1px;
7275
}
7376
}

backend/dashboard/assets/style/_utilities.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "variables" as *;
2+
13
// spacing utiltity classes
24
// utility classes for margins
35
@for $n from 0 through 6 {

backend/dashboard/assets/style/_variables.scss

+2-10
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ $size_extra-large: $size_1;
2424
$radius: 3px;
2525
$radius-large: 5px;
2626

27-
// Breakpoints
28-
// // Same as JS breakpoints at breakpoints.js
29-
// TODO: Redefine the breakpoints with @mmbotelho in a next task.
30-
$gap: 1rem;
31-
$phone_narrow: 441px;
32-
$tablet: 769px;
33-
$desktop: 1200px;
34-
3527
$transitionSpeed: 300ms;
3628
$formWidthConstraint: 36.5rem;
3729

@@ -41,5 +33,5 @@ $formWidthConstraint: 36.5rem;
4133
// tag of .vue components, and so those classes would end up being
4234
// duplicated across all the injected component CSS
4335

44-
@import "_mixins";
45-
@import "_colors";
36+
@forward "_mixins";
37+
@forward "_colors";

backend/dashboard/assets/style/components/_buttons.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../variables" as *;
2+
13
button,
24
.button {
35
position: relative;

backend/dashboard/assets/style/components/_forms.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../variables" as *;
2+
@use "../icons" as i;
3+
14
form {
25
display: block;
36
width: 100%;
@@ -178,7 +181,7 @@ p.error {
178181
user-select: none;
179182

180183
&::before {
181-
@include icon(close-circle);
184+
@include i.icon(close-circle);
182185
position: relative;
183186
top: 2px;
184187
display: inline-block;

backend/dashboard/assets/style/components/_miscellaneous.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../variables" as *;
2+
13
// Various global classes for styling UI elements that are used across the app
24

35
// section-title

backend/dashboard/assets/style/components/_skeletons.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../variables" as *;
2+
13
.skeleton {
24
position: relative;
35
display: block;

backend/dashboard/assets/style/components/_tables.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../variables" as *;
2+
13
table.table {
24
position: relative;
35

backend/dashboard/assets/style/main.scss

+12-13
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
// Files here are currently the replica of the same files in the 'group-income' project,
44
// but likely to be modified according to the design
5-
@import "_variables";
6-
@import "_reset";
7-
@import "_base";
8-
@import "_typography";
9-
@import "_utilities";
10-
@import "_icons";
11-
@import "_layout";
12-
@import "_transitions";
5+
@use "reset";
6+
@use "base";
7+
@use "typography";
8+
@use "utilities";
9+
@use "icons";
10+
@use "layout";
11+
@use "transitions";
1312

14-
@import "components/_buttons";
15-
@import "components/_miscellaneous";
16-
@import "components/_tables";
17-
@import "components/_forms";
18-
@import "components/_skeletons";
13+
@use "components/buttons";
14+
@use "components/miscellaneous";
15+
@use "components/tables";
16+
@use "components/forms";
17+
@use "components/skeletons";

backend/dashboard/views/utils/dummy-data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable */
22

33
// dummy placeholder data to be used in various pages
4-
import { createCID } from '@common/functions.js'
4+
import { createCID } from '~/shared/functions.js'
55
import { addTimeToDate, MONTHS_MILLIS } from '@common/cdTimeUtils.js'
66
import L from '@common/translations.js'
77

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)