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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Move still used mixins of Buttons from Foundation to code and remove the rest
Henriette Darge6583adee9aed
diff --git a/frontend/src/global_styles/content/_buttons.sass b/frontend/src/global_styles/content/_buttons.sassindex 689a8a5f4d9..65914c97bcc 100644--- a/frontend/src/global_styles/content/_buttons.sass+++ b/frontend/src/global_styles/content/_buttons.sass@@ -26,12 +26,29 @@// See COPYRIGHT and LICENSE files for more details.//+++/// Taken from Foundation for Apps+%button+ display: inline-block+ border: 0+ text-align: center+ line-height: 1.25rem+ cursor: pointer+ -webkit-appearance: none+ -webkit-font-smoothing: antialiased+ transition: background 0.25s ease-out+ vertical-align: middle+ padding: 0.375rem 0.5rem+ margin: 0 1rem 1rem 0+ font-size: 0.875rem+ border-radius: 2px++.button,a.button@extend %button@include button-size(medium)@include button-expand(false)- @include button-style(var(--button--background-color), var(--button--background-hover-color), var(--button--font-color), var(--button-style))+ @include button-style(var(--button--background-color), var(--button--background-hover-color), var(--button--font-color))border: 1px solid var(--button--border-color)position: relative@@ -61,29 +78,29 @@ a.buttonpadding-left: 0px&.-highlight- @include button-style(var(--button--highlight-background-color), var(--button--highlight-background-hover-color), var(--button--highlight-font-color), var(--button-style))- @include button-style(var(--button--highlight-background-color), var(--button--highlight-background-hover-color), var(--button--highlight-font-color), var(--button-style))+ @include button-style(var(--button--highlight-background-color), var(--button--highlight-background-hover-color), var(--button--highlight-font-color))+ @include button-style(var(--button--highlight-background-color), var(--button--highlight-background-hover-color), var(--button--highlight-font-color))border-color: var(--button--highlight-background-color)&:hover, &:focusborder-color: var(--button--highlight-background-hover-color)&.-highlight-inverted- @include button-style(#fff, #f2f2f2, var(--content-link-color), var(--button-style))- @include button-style(#fff, #f2f2f2, var(--content-link-color), var(--button-style))+ @include button-style(#fff, #f2f2f2, var(--content-link-color))+ @include button-style(#fff, #f2f2f2, var(--content-link-color))border-color: var(--content-link-color)&.-alt-highlight- @include button-style(var(--button--alt-highlight-background-color), var(--button--alt-highlight-background-hover-color), var(--button--alt-highlight-font-color), var(--button-style))- @include button-style(var(--button--alt-highlight-background-color), var(--button--alt-highlight-background-hover-color), var(--button--alt-highlight-font-color), var(--button-style))+ @include button-style(var(--button--alt-highlight-background-color), var(--button--alt-highlight-background-hover-color), var(--button--alt-highlight-font-color))+ @include button-style(var(--button--alt-highlight-background-color), var(--button--alt-highlight-background-hover-color), var(--button--alt-highlight-font-color))border-color: var(--button--alt-highlight-background-color)&:hover, &:focusborder-color: var(--button--alt-highlight-background-hover-color)&.-active- @include button-style(var(--button--active-background-color), var(--button--active-background-color), var(--button--active-font-color), var(--button-style))+ @include button-style(var(--button--active-background-color), var(--button--active-background-color), var(--button--active-font-color))border-color: var(--button--active-border-color)box-shadow: 0 0 3px var(--button--active-border-color) insetdiff --git a/frontend/src/global_styles/openproject/_mixins.sass b/frontend/src/global_styles/openproject/_mixins.sassindex 2cbe5db3f06..fc5e29bd403 100644--- a/frontend/src/global_styles/openproject/_mixins.sass+++ b/frontend/src/global_styles/openproject/_mixins.sass@@ -109,6 +109,56 @@border: none+/// Taken from Foundation for Apps+// Button mixins+$button-sizes: (tiny: 0.7, small: 0.8, medium: 1, large: 1.3)+$button-background: var(--button--background-color)+$button-background-hover: var(--button--background-hover-color)+$button-color: var(--button--font-color)+$button-style: solid+$button-radius: 0++@mixin button-size($size: medium, $expand: false)+ $size: 0.875rem * map-get($button-sizes, $size)+ font-size: $size++ @if $expand+ @include button-expand++@mixin button-expand($expand: true)+ @if $expand+ display: block+ width: 100%+ margin-left: 0+ margin-right: 0++ @else+ display: inline-block+ width: auto+ margin: 0 1rem 1rem 0++@mixin button-style($background: $button-background, $background-hover: $button-background-hover, $color: $button-color)+ @if $color == auto+ $color: is-light($background)++ background: $background+ color: $color++ &:hover, &:focus+ @if $background-hover == auto+ background: scale-color($background, $lightness: -15%)++ @else+ background: $background-hover+ color: $color+++@mixin button-disabled()+ opacity: 0.5+ cursor: default+ pointer-events: none++$scrollbar-color: #DDDDDD$scrollbar-size: 10pxdiff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_button.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_button.scssdeleted file mode 100644index dec5dbc761c..00000000000--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_button.scss+++ /dev/null@@ -1,205 +0,0 @@-/// @Foundation.settings-// Button-$button-padding: 0.85em 1em !default;-$button-margin: 0 $global-padding $global-padding 0 !default;-$button-style: solid !default;-$button-background: $primary-color !default;-$button-background-hover: scale-color($button-background, $lightness: -15%) !default;-$button-color: auto !default;-$button-radius: 0 !default;-$button-sizes: (- tiny: 0.7,- small: 0.8,- medium: 1,- large: 1.3,-) !default;-$button-font-size: 0.875rem !default;-$button-opacity-disabled: 0.5 !default;-$button-tag-selector: false !default;-///--%button {- display: inline-block;- border: 0;- text-align: center;- line-height: 1.25rem;- cursor: pointer;- -webkit-appearance: none;- -webkit-font-smoothing: antialiased;- transition: background 0.25s ease-out;- vertical-align: middle;-- padding: $button-padding;- margin: $button-margin;- font-size: $button-font-size;- border-radius: $button-radius;-- // Dropdown arrow- // TODO: Change to class and mixin because now the toggle is 'fa-open' which is too generic- // &[data-popup-toggle] {- // position: relative;- // padding-right: 2em; // Placeholder-- // &::after {- // @include css-triangle(6px, black, top);- // position: absolute;- // right: 0.7em;- // top: 50%;- // margin-top: -3px;- // }- // }-}--@mixin button-size($size: medium, $expand: false) {- $size: $button-font-size * map-get($button-sizes, $size);- font-size: $size;-- @if $expand {- @include button-expand;- }-- @if using(iconic) {- .iconic {- width: 1em;- height: 1em;- vertical-align: middle;- margin-right: 0.25em;- margin-top: -2px; // The icons are oddly misaligned- }- }-}--@mixin button-expand($expand: true) {- @if $expand {- display: block;- width: 100%;- margin-left: 0;- margin-right: 0;- }- @else {- display: inline-block;- width: auto;- margin: $button-margin;- }-}--@mixin button-style(- $background: $button-background,- $background-hover: $button-background-hover,- $color: $button-color,- $style: $button-style,- $radius: $button-radius,- $btngroup: false-){- @if $style == hollow {- border: 1px solid $background;- background: transparent;- color: $background;-- &:hover, &:focus {- border-color: scale-color($background, $lightness: 25%);- background: transparent;- color: scale-color($background, $lightness: 25%);- }- }- // Solid is the default- @else {- @if $color == auto {- $color: isitlight($background);- }-- background: $background;- color: $color;-- &:hover, &:focus {- @if $background-hover == auto {- background: scale-color($background, $lightness: -15%);- }- @else {- background: $background-hover;- }- color: $color;- }- }-- @if $btngroup {- border-color: $background;- &:hover, &:focus {- border-color: scale-color($background, $lightness: -25%);- }- }-- @if using(iconic) {- @if $style == hollow {- .iconic {- @include color-icon($background);- }- &:hover .iconic {- @include color-icon(scale-color($background, $lightness: 25%));- }- }- @else {- .iconic {- @include color-icon($color);- }- }- }-}--@mixin button-disabled() {- opacity: $button-opacity-disabled;- cursor: default;- pointer-events: none;-}--@mixin button(- $size: medium,- $expand: false,- $background: $button-background,- $background-hover: $button-background-hover,- $color: $button-color,- $style: $button-style,- $radius: $button-radius-) {- @extend %button;- @include button-size($size);- @include button-expand($expand);- @include button-style($background, $background-hover, $color, $style);-}--@include exports(button) {- .button {- @include button;-- &.tiny { @include button-size(tiny); }- &.small { @include button-size(small); }- &.large { @include button-size(large); }- &.expand { @include button-expand; }-- &.secondary { @include button-style($secondary-color, auto) }- &.success { @include button-style($success-color, auto) }- &.warning { @include button-style($warning-color, auto) }- &.alert { @include button-style($alert-color, auto) }- &.info { @include button-style($info-color, auto) }- &.dark { @include button-style($dark-color, auto) }-- @if $button-style != hollow {- &.hollow { @include button-style($style: hollow);- &.secondary { @include button-style($secondary-color, $style: hollow); }- &.success { @include button-style($success-color, $style: hollow); }- &.warning { @include button-style($warning-color, $style: hollow); }- &.alert { @include button-style($alert-color, $style: hollow); }- &.info { @include button-style($info-color, $style: hollow); }- &.dark { @include button-style($dark-color, $style: hollow); }- }- }-- &.disabled { @include button-disabled; }- }-- @if $button-tag-selector {- button {- @extend .button;- }- }-}diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scssindex 256e2b19674..0c21178c914 100755--- a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss@@ -20,7 +20,6 @@ $foundation-version: '1.1.0';@import "global";// Components-@import "components/button",-"components/forms",+@import "components/forms","components/grid","components/typography";