Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(frontend): reduce scss bundle

johaven6eaddc2f112c
diff --git a/frontend/src/styles/bootstrap-custom.scss b/frontend/src/styles/bootstrap-custom.scss
new file mode 100644
index 00000000..118595bf
--- /dev/null
+++ b/frontend/src/styles/bootstrap-custom.scss
@@ -0,0 +1,36 @@
+// Bootstrap is imported in modules to avoid shipping unused components.
+@import 'bootstrap/scss/functions';
+
+// variables.scss is loaded before this file from index.scss to override Bootstrap defaults.
+@import 'bootstrap/scss/variables';
+@import 'bootstrap/scss/maps';
+@import 'bootstrap/scss/mixins';
+@import 'bootstrap/scss/utilities';
+
+// Base
+@import 'bootstrap/scss/root';
+@import 'bootstrap/scss/reboot';
+@import 'bootstrap/scss/type';
+@import 'bootstrap/scss/images';
+@import 'bootstrap/scss/containers';
+@import 'bootstrap/scss/grid';
+
+// Used components
+@import 'bootstrap/scss/tables';
+@import 'bootstrap/scss/forms';
+@import 'bootstrap/scss/buttons';
+@import 'bootstrap/scss/transitions';
+@import 'bootstrap/scss/dropdown';
+@import 'bootstrap/scss/button-group';
+@import 'bootstrap/scss/nav';
+@import 'bootstrap/scss/card';
+@import 'bootstrap/scss/pagination';
+@import 'bootstrap/scss/badge';
+@import 'bootstrap/scss/alert';
+@import 'bootstrap/scss/progress';
+@import 'bootstrap/scss/list-group';
+@import 'bootstrap/scss/close';
+@import 'bootstrap/scss/modal';
+@import 'bootstrap/scss/tooltip';
+@import 'bootstrap/scss/helpers';
+@import 'bootstrap/scss/utilities/api';
diff --git a/frontend/src/styles/components/_boxes.scss b/frontend/src/styles/components/_boxes.scss
index cf35e3f6..206e2883 100644
--- a/frontend/src/styles/components/_boxes.scss
+++ b/frontend/src/styles/components/_boxes.scss
@@ -5,66 +5,6 @@
margin-bottom: 10px;
width: 100%;
box-shadow: $box-boxshadow;
-
- &.box-primary {
- border-top-color: $primary;
- }
-
- &.box-info {
- border-top-color: $aqua;
- }
-
- &.box-purple {
- border-top-color: $purple;
- }
-
- &.box-danger {
- border-top-color: $red;
- }
-
- &.box-warning {
- border-top-color: $yellow;
- }
-
- &.box-success {
- border-top-color: $green;
- }
-
- &.box-default {
- border-top-color: $black;
- }
-
- &.box-solid {
- border-top: 0;
-
- &.box-primary {
- @include box-solid-variant($primary);
- }
-
- &.box-purple {
- @include box-solid-variant($purple);
- }
-
- &.box-info {
- @include box-solid-variant($aqua);
- }
-
- &.box-dark {
- @include box-solid-variant($black)
- }
-
- &.box-danger {
- @include box-solid-variant($red);
- }
-
- &.box-warning {
- @include box-solid-variant($orange);
- }
-
- &.box-success {
- @include box-solid-variant($green);
- }
- }
}
.box-transparent {
@@ -148,42 +88,6 @@
outline: none;
cursor: pointer;
}
-
- &.box-footer-success {
- background-color: $success;
- color: $white;
-
- &:hover {
- background-color: darken($success, 5%);
- }
- }
-
- &.box-footer-warning {
- background-color: $warning;
- color: $white;
-
- &:hover {
- background-color: darken($warning, 5%);
- }
- }
-
- &.box-footer-primary {
- background-color: $primary;
- color: $white;
-
- &:hover {
- background-color: darken($primary, 5%);
- }
- }
-
- &.box-footer-purple {
- background-color: $purple;
- color: $white;
-
- &:hover {
- background-color: darken($purple, 5%);
- }
- }
}
.box-header,
diff --git a/frontend/src/styles/components/_buttons.scss b/frontend/src/styles/components/_buttons.scss
index 3e5a7fe1..711d1130 100644
--- a/frontend/src/styles/components/_buttons.scss
+++ b/frontend/src/styles/components/_buttons.scss
@@ -25,10 +25,6 @@
@include button-size($btn-padding-y-xs, $btn-padding-x-xs, $font-size-3xs, $btn-border-radius-sm);
}
-.btn-group-xs > .btn {
- @extend .btn-xs;
-}
-
.btn-outline-secondary-alt {
@extend .btn-outline-secondary;
}
diff --git a/frontend/src/styles/components/_header.scss b/frontend/src/styles/components/_header.scss
index 3bf5d28f..8dcea8a6 100644
--- a/frontend/src/styles/components/_header.scss
+++ b/frontend/src/styles/components/_header.scss
@@ -10,6 +10,8 @@
transition: margin-left $transition-speed $transition-fn;
.navbar {
+ display: flex;
+ width: 100%;
margin-bottom: 0;
margin-left: 0;
max-height: $navbar-height;
diff --git a/frontend/src/styles/components/_links.scss b/frontend/src/styles/components/_links.scss
index 4c9a716f..5e704626 100755
--- a/frontend/src/styles/components/_links.scss
+++ b/frontend/src/styles/components/_links.scss
@@ -67,10 +67,5 @@
font-size: 18px;
font-weight: 400;
}
-
- .search-form {
- display: inline-block;
- margin: 50px 0 80px 0;
- }
}
}
diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss
index b52f88c6..fd8e15b4 100644
--- a/frontend/src/styles/index.scss
+++ b/frontend/src/styles/index.scss
@@ -2,8 +2,8 @@
@import '@fontsource-variable/inter';
// Overload bootstrap variables
@import 'variables';
-// Load Bootstrap 5
-@import 'bootstrap/scss/bootstrap';
+// Load Bootstrap 5 (modular import to reduce bundle size)
+@import 'bootstrap-custom';
@import 'components';
// used for ngx-toastr
@import 'ngx-toastr/toastr-bs5-alert';