Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove more unused code. For the "toast" class we switch to the mixin we already have instead of using foundations which are overwritten in most cases anyway

Henriette Darge230438858db0
diff --git a/frontend/src/global_styles/content/_toast.sass b/frontend/src/global_styles/content/_toast.sass
index ea9d3f75462..f1d27613f47 100644
--- a/frontend/src/global_styles/content/_toast.sass
+++ b/frontend/src/global_styles/content/_toast.sass
@@ -101,14 +101,11 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
left: $left
font-size: $size
+
+
.op-toast
- @extend %toaster
@include spot-z-index("toast")
- +toaster-layout($x: left, $y: top, $size: auto, $offset: rem-calc(0))
- +toaster-style($background: $nm-color-background, $color: var(--body-font-color), $padding: $nm-padding-box, $radius: $nm-border-radius)
- .toaster-icon
- +toaster-icon($size: $toaster-icon-size, $margin: $toaster-icon-margin, $align: $toaster-icon-align)
display: flex
box-shadow: rem-calc(1px 2px 3px) rgba(0, 0, 0, 0.2)
border: rem-calc(1px) solid $nm-color-border
@@ -160,16 +157,21 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
@include messages-icon
@extend %nm-icon-warning
- &.-info::before
+ &.-info
@extend %info-placeholder
- @include messages-icon
- @extend %nm-icon-info
- &.-ee-upsale::before
+ &::before
+ @include messages-icon
+ @extend %nm-icon-info
+
+ &.-ee-upsale
@extend %info-placeholder
- @include messages-icon
+
+ &::before
+ @include messages-icon
&.-upload
+ @extend %info-placeholder
padding: $nm-upload-box-padding
//@hack adapting to provided styles
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_extras.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_extras.scss
deleted file mode 100644
index 1e2443a3f14..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_extras.scss
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Odds and ends.
-*/
-
-/// @Foundation.settings
-// Extras
-$closebutton-position: (top right) !default;
-$closebutton-size: 2em !default;
-$closebutton-lineheight: 0.5 !default;
-$closebutton-color: #999 !default;
-$closebutton-color-hover: #333 !default;
-
-$thumbnail-padding: 0.5rem !default;
-$thumbnail-shadow: 0 3px 15px rgba(black, 0.25) !default;
-///
-
-// A basic close button. They pin to the corner of the thing they're inside.
-%close-button {
- $x: nth($closebutton-position, 1);
- $y: nth($closebutton-position, 2);
-
- position: absolute;
- color: $closebutton-color;
- #{$x}: $global-padding;
- #{$y}: $global-padding;
- font-size: $closebutton-size;
- line-height: $closebutton-lineheight;
- cursor: pointer;
-
- &:hover {
- color: $closebutton-color-hover;
- }
-}
-
-// Make your images fancy-like.
-%thumbnail {
- padding: $thumbnail-padding;
- box-shadow: $thumbnail-shadow;
-}
-
-@include exports(extras) {
- .close-button {
- @extend %close-button;
- }
- .thumbnail {
- @extend %thumbnail;
- }
- ul.thumbnails > li {
- margin-bottom: 1rem;
-
- a { display: block; }
- img { @extend %thumbnail; }
- }
-}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_grid.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_grid.scss
index ec58f3bac14..90f2d1b4ee2 100644
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_grid.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_grid.scss
@@ -1,7 +1,4 @@
@use "sass:math";
-
-@import "panel";
-
/*
THE GRID
--------
@@ -368,31 +365,6 @@ $block-grid-max-size: 6 !default;
&.contain-right { @include grid-container($align: right); }
}
- // Breakpoint classes for blocks
- @each $size in $breakpoint-classes {
- .#{$size}-grid-block {
- @extend %block-core;
- @extend %child-core;
-
- @include breakpoint($size) {
- @include grid-block;
-
- // Override panel styles
- &.panel { @include grid-panel-reset; }
- }
- }
- .#{$size}-grid-content {
- @extend %child-core;
-
- @include breakpoint($size) {
- @include grid-content;
-
- // Override panel styles
- &.panel { @include grid-panel-reset; }
- }
- }
- }
-
// Sizing and ordering classes
@for $i from 1 through $total-columns {
// Source ordering
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_list.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_list.scss
deleted file mode 100755
index 70937ae452d..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_list.scss
+++ /dev/null
@@ -1,19 +0,0 @@
-@mixin inline-list($alignment){
- list-style-type: none;
- text-align: $alignment;
- li, dt, dd {
- display: inline-block;
- margin-left: -2px;
- margin-right: -2px;
- }
-}
-
-@include exports(list) {
- .inline-list {
- @include inline-list(left);
- li {
- margin-right: 1rem;
- margin-left: 0;
- }
- }
-}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_modal.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_modal.scss
deleted file mode 100644
index d8c5bc2a604..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_modal.scss
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- MODAL
- -----
-
- The humble modal hides off-canvas until summoned with an fa-open directive. Modals appear over an overlay that darkens the rest of the page, and have a maximum width. You can construct a grid inside a modal, or attach panels to it.
-
- Note that the modal overlay is hardcoded into the CSS, because whether or not you build your modal semantically, the overlay is always required and will always look the same.
-*/
-
-/// @Foundation.settings
-// Modal
-$modal-background: #fff !default;
-$modal-border: 0 !default;
-$modal-radius: 0px !default;
-$modal-shadow: none !default;
-$modal-zindex: 1000 !default;
-$modal-sizes: (
- tiny: 300px,
- small: 500px,
- medium: 600px,
- large: 800px,
-) !default;
-
-$modal-overlay-class: 'modal-overlay' !default;
-$modal-overlay-background: rgba(#333, 0.7) !default;
-///
-
-%modal {
- position: relative;
- z-index: $modal-zindex + 1;
- background: $modal-background;
- flex: 0 0 auto;
- width: 100%;
- height: var(--app-height);
- max-height: 100%;
- overflow: hidden;
- padding: $global-padding;
-
- @include breakpoint(medium) {
- height: auto;
- max-width: map-get($modal-sizes, medium);
- }
-
- .grid-content, .grid-block {
- margin: 0;
- }
-
- .close-button, [fa-close] {
- z-index: $modal-zindex + 1;
- }
-}
-
-@mixin modal-dialog() {
- height: auto;
-}
-@mixin modal-layout(
- $width: map-get($modal-sizes, medium),
- $dialog: false
-) {
- max-width: $width;
-}
-@mixin modal-style(
- $border: $modal-border,
- $radius: $modal-radius,
- $shadow: $modal-shadow
-) {
- @if $border != 0 {
- border: $border;
- }
- @if $radius != 0px {
- border-radius: $radius;
- }
- @if $shadow != none {
- box-shadow: $shadow;
- }
-}
-
-@mixin modal(
- $width: map-get($modal-sizes, medium),
- $border: $modal-border,
- $radius: $modal-radius,
- $shadow: $modal-shadow
-) {
- @extend %modal;
- @include modal-layout($width);
- @include modal-style($border, $radius, $shadow);
-}
-
-@include exports(modal) {
- .modal {
- @include modal;
-
- @each $size in map-keys($modal-sizes) {
- $width: map-get($modal-sizes, $size);
- @if $size != medium {
- .#{$size} > & { @include modal-layout($width); }
- }
- }
-
- .dialog > & {
- @include modal-dialog;
- }
- .collapse > & {
- padding: 0;
- }
- }
-
- .#{$modal-overlay-class} {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: $modal-zindex;
- display: none;
- background-color: $modal-overlay-background;
-
- // Horizontally and vertically center the modal
- align-items: center;
- justify-content: center;
-
- &.is-active {
- display: flex;
- }
- }
-}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_panel.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_panel.scss
deleted file mode 100644
index 58554196a64..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_panel.scss
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- PANEL
- -----
-
- The friendly panel is an all-purpose container for hiding content off-screen.
-
- Features:
- - Position at top, right, bottom, or left
- - Anchor to grid block or window
- - Define max width or height
- - Transform into grid block depending on screen size
-*/
-
-/// @Foundation.settings
-// Panel
-$panel-size-horizontal: 300px !default;
-$panel-size-vertical: 300px !default;
-$panel-padding: 0 !default;
-
-$panel-background: #fff !default;
-$panel-shadow: 3px 0 10px rgba(black, 0.25) !default;
-
-// DEPRECATED: these variables will be removed in a future version.
-$panel-animation-speed: 0.25s !default;
-///
-
-%panel-base {
- display: block;
- position: absolute;
- z-index: 100;
- overflow-y: auto;
- display: none;
-
- &.is-active {
- display: block;
- }
-}
-
-@mixin panel-layout(
- $position: left,
- $size: default,
- $shadow: $panel-shadow
-) {
- @if $size == default {
- @if $position == left or $position == right {
- $size: $panel-size-horizontal;
- }
- @if $position == top or $position == bottom {
- $size: $panel-size-vertical;
- }
- }
-
- /*
- Direction
- */
- @if $position == top {
- top: 0;
- left: 0;
- width: 100%;
- }
- @else if $position == right {
- top: 0;
- right: 0;
- height: 100%;
- }
- @else if $position == bottom {
- bottom: 0;
- left: 0;
- width: 100%;
- }
- @else if $position == left {
- top: 0;
- left: 0;
- height: 100%;
- }
-
- /*
- Sizing
- */
- // Horizontal panels are always all the way tall and have a set width
- @if $position == left or $position == right {
- @if unit($size) == '%' {
- width: $size;
- }
- @else {
- width: 100%;
- @include breakpoint($size) {
- width: $size;
- }
- }
- }
- // (For now) vertical panels don't change size
- @if $position == top or $position == bottom {
- height: $size;
- }
-
- /*
- Shadows
- */
- $shadow-distance: get-shadow-value($shadow, x);
- $shadow-size: get-shadow-value($shadow, size);
- $shadow-color: get-shadow-value($shadow, color);
- &.is-active {
- @if $position == left { box-shadow: $shadow-distance 0 $shadow-size $shadow-color; }
- @else if $position == right { box-shadow: (-$shadow-distance) 0 $shadow-size $shadow-color; }
- @else if $position == top { box-shadow: 0 $shadow-distance $shadow-size $shadow-color; }
- @else if $position == bottom { box-shadow: 2px (-$shadow-distance) $shadow-size $shadow-color; }
- }
-}
-
-@mixin panel-style(
- $padding: $panel-padding,
- $background: $panel-background
-) {
- /*
- Basic styles
- */
- padding: $padding;
- background: $background;
-}
-
-@include exports(panel) {
- .panel {
- @extend %panel-base;
- @include panel-style;
- }
-
- .panel-top { @include panel-layout(top); }
- .panel-right { @include panel-layout(right); }
- .panel-bottom { @include panel-layout(bottom); }
- .panel-left { @include panel-layout(left); }
-
- .panel-fixed { position: fixed; }
-}
\ No newline at end of file
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss
deleted file mode 100644
index 34298430314..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- TOAST
- ------------
-
- An alert that pins to the corner of the screen when triggered by JavaScript. It can be set to disappear after a certain period of time, or to stay put until the user clicks on it. A custom action can be assigned to a toaster as well.
-
- Optionally, the toasters directive can also tap into the browser's native toaster support, if it exists.
-*/
-
-/// @Foundation.settings
-// Notification
-$toaster-default-position: right top !default;
-$toaster-width: rem-calc(400) !default;
-$toaster-offset: $global-padding !default;
-
-$toaster-background: $primary-color !default;
-$toaster-color: white !default;
-$toaster-padding: $global-padding !default;
-$toaster-radius: 4px !default;
-
-$toaster-icon-size: 60px !default;
-$toaster-icon-margin: $global-padding !default;
-$toaster-icon-align: top !default;
-
-///
-
-%toaster {
- z-index: 1000;
- display: flex;
- position: relative;
- margin-top: .5rem;
- margin-bottom: .5rem;
- display: none;
-
- h1 {
- font-size: 1.25em;
- margin: 0;
- }
- p {
- margin: 0;
- }
-
- // Placeholder animation
- // transition: opacity 1s ease-out;
-
- &.is-active {
- display: flex;
- }
-
- .close-button {
- color: white;
- }
-}
-
-%toaster-container {
- z-index: 3000;
- position: fixed;
-
- display: flex;
- flex-direction: column;
-}
-
-@mixin toaster-layout(
- $x: nth($toaster-default-position, 1),
- $y: nth($toaster-default-position, 2),
- $size: $toaster-width,
- $offset: $toaster-offset
-) {
- width: $size;
-
- @if $x == right {
- right: $offset;
- }
- @else if $x == left {
- left: $offset;
- }
- @else if $x == middle {
- left: 50%;
- margin-left: -($size * 0.5);
- }
-
- @if $y == top {
- top: $offset;
- }
- @else if $y == bottom {
- top: auto;
- bottom: $offset;
- }
-
- // On small screens, toasters are full width but maintain their vertical orientation
- @include breakpoint(small only) {
- width: auto;
- left: $offset;
- right: $offset;
- margin-left: 0;
- }
-}
-@mixin toaster-style(
- $background: $toaster-background,
- $color: $toaster-color,
- $padding: $toaster-padding,
- $radius: $toaster-radius
-) {
- background: $background;
- padding: $padding;
- border-radius: $radius;
-
- &, h1, h2, h3, h4, h5, h6 {
- color: $color;
- }
-}
-
-@mixin toaster(
- $background: $toaster-background,
- $color: $toaster-color,
- $padding: $toaster-padding,
- $radius: $toaster-radius
-) {
- @extend %toaster;
- @include toaster-style($background, $color, $padding, $radius);
-}
-
-@mixin toaster-container(
- $x: nth($toaster-default-position, 1),
- $y: nth($toaster-default-position, 2),
- $size: $toaster-width,
- $offset: $toaster-offset
-) {
- @extend %toaster-container;
- @include toaster-layout($x, $y, $size, $offset);
-}
-
-@mixin toaster-icon(
- $size: $toaster-icon-size,
- $margin: $toaster-icon-margin,
- $align: $toaster-icon-align
-) {
- $alignments: (
- top: flex-start,
- middle: middle,
- bottom: flex-end,
- );
- flex: 0 0 $size;
- margin-right: $global-padding;
- align-self: map-get($alignments, $align);
-
- img {
- width: 100%;
- height: auto;
- }
-}
-
-/*
- CSS Output
-*/
-
-@include exports(toaster) {
- .toaster {
- @include toaster;
-
- &.success { @include toaster-style($success-color) }
- &.warning { @include toaster-style($warning-color) }
- &.alert { @include toaster-style($alert-color) }
- &.dark { @include toaster-style($dark-color, #fff) }
-
-
- }
-
- .static-toaster {
- @include toaster;
-
- position: fixed !important;
-
- &.top-right { @include toaster-layout(right, top); }
- &.top-left { @include toaster-layout(left, top); }
- &.top-middle { @include toaster-layout(middle, top); }
-
- &.bottom-right { @include toaster-layout(right, bottom); }
- &.bottom-left { @include toaster-layout(left, bottom); }
- &.bottom-middle { @include toaster-layout(middle, bottom); }
-
- &.success { @include toaster-style($success-color) }
- &.warning { @include toaster-style($warning-color) }
- &.alert { @include toaster-style($alert-color) }
- &.dark { @include toaster-style($dark-color, #fff) }
- }
-
- .toaster-container {
- @include toaster-container;
-
- &.top-right { @include toaster-layout(right, top); }
- &.top-left { @include toaster-layout(left, top); }
- &.top-middle { @include toaster-layout(middle, top); }
-
- &.bottom-right { @include toaster-layout(right, bottom); }
- &.bottom-left { @include toaster-layout(left, bottom); }
- &.bottom-middle { @include toaster-layout(middle, bottom); }
- }
-
- .toaster-icon {
- @include toaster-icon;
- }
- .toaster-content {
- flex: 1;
- }
-
-}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
index 743e401d4a1..424db179352 100755
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
@@ -22,14 +22,10 @@ $foundation-version: '1.1.0';
// Components
@import "components/button",
-"components/extras",
"components/forms",
"components/grid",
"components/label",
-"components/list",
-"components/modal",
"components/motion",
-"components/toast",
"components/tabs",
"components/typography",
"components/utilities";