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

Move basic form styles to its own file and remove global styles from Foundation which are not used any more

Henriette Dargefd3838d57287
diff --git a/frontend/src/global_styles/content/_collapsible_section.sass b/frontend/src/global_styles/content/_collapsible_section.sass
index 4193ded4bfb..563b3b96a9b 100644
--- a/frontend/src/global_styles/content/_collapsible_section.sass
+++ b/frontend/src/global_styles/content/_collapsible_section.sass
@@ -24,7 +24,7 @@
font-weight: bold
line-height: 1.8
text-transform: uppercase
- border-bottom: 1px solid $gray
+ border-bottom: 1px solid var(--gray)
&:hover, &:focus
color: var(--body-font-color)
diff --git a/frontend/src/global_styles/content/_forms.sass b/frontend/src/global_styles/content/_forms.sass
index dbfa91332b7..1c227d07bc2 100644
--- a/frontend/src/global_styles/content/_forms.sass
+++ b/frontend/src/global_styles/content/_forms.sass
@@ -233,7 +233,7 @@ hr
font-weight: bold
line-height: 1.8
text-transform: uppercase
- border-bottom: 1px solid $gray
+ border-bottom: 1px solid var(--gray)
// HACK. TODO: Remove fieldset element rules in various places.
.form--fieldset,
@@ -758,7 +758,7 @@ input[readonly].-clickable
.form--matrix-header-row
font-weight: bold
border-bottom: var(--content-form-input-border)
- background-color: $gray-light
+ background-color: var(--gray-light)
.form--matrix-header-cell
padding: 0 1rem
@@ -766,7 +766,7 @@ input[readonly].-clickable
.form--matrix-row
&:nth-child(odd)
- background-color: $gray-light
+ background-color: var(--gray-light)
&:nth-child(even)
background-color: white
diff --git a/frontend/src/global_styles/content/_grid.sass b/frontend/src/global_styles/content/_grid.sass
index 7a43867ab91..1bed7da3a02 100644
--- a/frontend/src/global_styles/content/_grid.sass
+++ b/frontend/src/global_styles/content/_grid.sass
@@ -217,7 +217,7 @@ body.widget-grid-layout
align-items: center
padding: 0
border-radius: initial
-
+
&:before
font-size: 0.75rem
@@ -247,7 +247,7 @@ body.widget-grid-layout
transition: background 4s ease
&:hover
- background: $gray-light
+ background: var(--gray-light)
transition: background 1s ease
&:last-of-type
diff --git a/frontend/src/global_styles/content/_simple_filters.sass b/frontend/src/global_styles/content/_simple_filters.sass
index 7ee57f0e1f5..a7a4d5ecbe2 100644
--- a/frontend/src/global_styles/content/_simple_filters.sass
+++ b/frontend/src/global_styles/content/_simple_filters.sass
@@ -26,8 +26,8 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-$filters--background-color: $gray-light !default
-$filters--border-color: $gray !default
+$filters--background-color: var(--gray--light) !default
+$filters--border-color: var(--gray) !default
%filters--container
background-color: $filters--background-color
diff --git a/frontend/src/global_styles/content/_table.sass b/frontend/src/global_styles/content/_table.sass
index 07b09c113c4..2bf4a3862e9 100644
--- a/frontend/src/global_styles/content/_table.sass
+++ b/frontend/src/global_styles/content/_table.sass
@@ -51,7 +51,7 @@ $toolbar-height--mobile: 100px
.generic-table--container
display: contents
-
+
.generic-table
position: relative
@@ -231,7 +231,7 @@ table.generic-table
white-space: nowrap
&.-no-highlighting
- background-color: $body-background
+ background-color: var(--body-background)
// Enable sticky headers
thead.-sticky th
@@ -318,9 +318,9 @@ thead.-sticky th
visibility: visible
.generic-table--no-results-container
- background: $gray-light
- border: 1px solid $gray
- border-radius: $global-radius
+ background: var(--gray-light)
+ border: 1px solid var(--gray)
+ border-radius: 4px
padding: 14px 14px 14px 36px
display: block
diff --git a/frontend/src/global_styles/content/_types_form_configuration.sass b/frontend/src/global_styles/content/_types_form_configuration.sass
index f5cef6c374d..8a6efe128fd 100644
--- a/frontend/src/global_styles/content/_types_form_configuration.sass
+++ b/frontend/src/global_styles/content/_types_form_configuration.sass
@@ -36,7 +36,7 @@
.delete-group,
.delete-attribute
cursor: pointer
-
+
&.-error
background: var(--content-form-error-color)
.group-name
@@ -61,7 +61,7 @@
padding: 7px 7px 7px 0px
margin-bottom: 2px
- background: $gray-light
+ background: var(--gray-light)
border-top-left-radius: 2px
border-bottom-left-radius: 2px
diff --git a/frontend/src/global_styles/openproject/_base.sass b/frontend/src/global_styles/openproject/_base.sass
index f3ed34848ea..0335fc1372e 100644
--- a/frontend/src/global_styles/openproject/_base.sass
+++ b/frontend/src/global_styles/openproject/_base.sass
@@ -25,7 +25,18 @@
//
// See COPYRIGHT and LICENSE files for more details.
//++
-@import "variables"
+
+
+html, body
+ height: 100%
+ font-size: var(--body-font-size)
+
+// Set box-sizing globally to handle padding and border widths
+html
+ box-sizing: border-box
+
+*, *:before, *:after
+ box-sizing: inherit
body
// avoid applying font-family from primer
@@ -39,166 +50,3 @@ dl
ul,
ol
margin-left: 2rem
-
-/*
- FORMS (taken from Foundation for Apps)
- -----
-
- Our form styles include basic resets for text fields, select menus, and so on, along with some of our own custom components.
-
- Includes:
- - Text fields
- - Text areas
- - Select menus
- - Checkboxes and radio buttons
- - Range slider
- - Progress bars and meters
-
-// Basic form variables
-$form-fontsize: 1rem !default
-$form-padding: 0.5rem !default
-
-// Text fields
-$input-color: #000 !default
-$input-color-hover: $input-color !default
-$input-color-focus: $input-color !default
-$input-background: #fff !default
-$input-background-hover: $input-background !default
-$input-background-focus: $input-background !default
-$input-border: 1px solid #ccc !default
-$input-border-hover: 1px solid #bbb !default
-$input-border-focus: 1px solid #999 !default
-
-// Labels
-$form-label-margin: 0.5rem !default
-$form-label-color: #333 !default
-
-// Inline labels
-$inlinelabel-color: #333 !default
-$inlinelabel-background: #eee !default
-$inlinelabel-border: $input-border !default
-
-// Select menus
-$select-color: #000 !default
-$select-background: #fafafa !default
-$select-background-hover: smartscale($select-background, 4%) !default
-$select-arrow: true !default
-$select-arrow-color: $select-color !default
-
-// Text fields
-// - - - - - - - - - - - - - - - - - - - - - - - - -
-#{$text-input-selectors}
- $top-padding: get-side($form-padding, top)
- $bottom-padding: get-side($form-padding, bottom)
- $height: ($form-fontsize * 1.4) + $top-padding + $bottom-padding
-
- @include no-appearance
- display: block
- width: 100%
- height: $height
- padding: $form-padding
- margin: 0 0 1rem 0
- border: $input-border
- border-radius: 2px
- background: $input-background
- color: $input-color
- font-size: $form-fontsize
- -webkit-font-smoothing: antialiased
- vertical-align: middle
-
- &:hover
- border: $input-border-hover
- background: $input-background-hover
- color: $input-color-hover
-
- &:focus
- border: $input-border-focus
- background: $input-background-focus
- color: $input-color-focus
-
- label > &
- margin-top: $form-label-margin
-
-// Inline labels
-// Inline labels allow you to prefix or postfix special labels to inputs
-// - - - - - - - - - - - - - - - - - - - - - - - - -
-.inline-label
- display: flex
- flex-flow: row nowrap
- align-items: stretch
- margin-bottom: 1rem
-
- // Imitates the top margin on normal inputs
- label > &
- margin-top: $form-label-margin
-
- // Inputs stretch all the way out
- > input, > select
- flex: 1 1 auto
- margin: 0
-
- // Inline labels and buttons shrink
- > .form-label
- flex: 0 0 auto
- background: $inlinelabel-background
- color: $inlinelabel-color
- border: $inlinelabel-border
- padding: 0 $form-padding
- display: flex
- align-items: center
-
- &:first-child
- border-right: 0
- &:last-child
- border-left: 0
-
- // Buttons also shrink
- > a,
- > button,
- > input[type="button"],
- > input[type="submit"]
- flex: 0 0 auto
- display: flex
- align-items: center
- padding-top: 0
- padding-bottom: 0
- margin: 0
- border-radius: 0
-
-
-// Text areas
-// - - - - - - - - - - - - - - - - - - - - - - - - -
-textarea
- height: auto
- width: 100%
- min-height: 50px
-
-
-// Select menus
-// - - - - - - - - - - - - - - - - - - - - - - - - -
-select
- $top-padding: get-side($form-padding, top)
- $bottom-padding: get-side($form-padding, bottom)
- $height: ($form-fontsize * 1.4) + $top-padding + $bottom-padding
- $color: is-light($select-background)
-
- @include no-appearance
- display: block
- width: 100%
- height: $height
- padding: $form-padding
- color: $select-color
- border-radius: 0
- border: $input-border
-
- @if $select-arrow
- background: $select-background url(image-triangle($select-arrow-color)) right 10px center no-repeat
- background-size: 8px 8px
- padding-right: rem-calc(18px) + $form-padding
-
- @else
- background-color: $select-background
-
-
- &:hover
- background-color: $select-background-hover
diff --git a/frontend/src/global_styles/openproject/_forms.sass b/frontend/src/global_styles/openproject/_forms.sass
new file mode 100644
index 00000000000..72193af9c42
--- /dev/null
+++ b/frontend/src/global_styles/openproject/_forms.sass
@@ -0,0 +1,192 @@
+//-- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+@import "variables"
+
+/*
+ FORMS (taken from Foundation for Apps)
+ -----
+
+ Our form styles include basic resets for text fields, select menus, and so on, along with some of our own custom components.
+
+ Includes:
+ - Text fields
+ - Text areas
+ - Select menus
+ - Checkboxes and radio buttons
+ - Range slider
+ - Progress bars and meters
+
+// Basic form variables
+$form-fontsize: 1rem !default
+$form-padding: 0.5rem !default
+
+// Text fields
+$input-color: #000 !default
+$input-color-hover: $input-color !default
+$input-color-focus: $input-color !default
+$input-background: #fff !default
+$input-background-hover: $input-background !default
+$input-background-focus: $input-background !default
+$input-border: 1px solid #ccc !default
+$input-border-hover: 1px solid #bbb !default
+$input-border-focus: 1px solid #999 !default
+
+// Labels
+$form-label-margin: 0.5rem !default
+$form-label-color: #333 !default
+
+// Inline labels
+$inlinelabel-color: #333 !default
+$inlinelabel-background: #eee !default
+$inlinelabel-border: $input-border !default
+
+// Select menus
+$select-color: #000 !default
+$select-background: #fafafa !default
+$select-background-hover: smartscale($select-background, 4%) !default
+$select-arrow: true !default
+$select-arrow-color: $select-color !default
+
+// Text fields
+// - - - - - - - - - - - - - - - - - - - - - - - - -
+#{$text-input-selectors}
+ $top-padding: get-side($form-padding, top)
+ $bottom-padding: get-side($form-padding, bottom)
+ $height: ($form-fontsize * 1.4) + $top-padding + $bottom-padding
+
+ @include no-appearance
+ display: block
+ width: 100%
+ height: $height
+ padding: $form-padding
+ margin: 0 0 1rem 0
+ border: $input-border
+ border-radius: 2px
+ background: $input-background
+ color: $input-color
+ font-size: $form-fontsize
+ -webkit-font-smoothing: antialiased
+ vertical-align: middle
+
+ &:hover
+ border: $input-border-hover
+ background: $input-background-hover
+ color: $input-color-hover
+
+ &:focus
+ border: $input-border-focus
+ background: $input-background-focus
+ color: $input-color-focus
+
+ label > &
+ margin-top: $form-label-margin
+
+// Inline labels
+// Inline labels allow you to prefix or postfix special labels to inputs
+// - - - - - - - - - - - - - - - - - - - - - - - - -
+.inline-label
+ display: flex
+ flex-flow: row nowrap
+ align-items: stretch
+ margin-bottom: 1rem
+
+ // Imitates the top margin on normal inputs
+ label > &
+ margin-top: $form-label-margin
+
+ // Inputs stretch all the way out
+ > input, > select
+ flex: 1 1 auto
+ margin: 0
+
+ // Inline labels and buttons shrink
+ > .form-label
+ flex: 0 0 auto
+ background: $inlinelabel-background
+ color: $inlinelabel-color
+ border: $inlinelabel-border
+ padding: 0 $form-padding
+ display: flex
+ align-items: center
+
+ &:first-child
+ border-right: 0
+ &:last-child
+ border-left: 0
+
+ // Buttons also shrink
+ > a,
+ > button,
+ > input[type="button"],
+ > input[type="submit"]
+ flex: 0 0 auto
+ display: flex
+ align-items: center
+ padding-top: 0
+ padding-bottom: 0
+ margin: 0
+ border-radius: 0
+
+
+// Text areas
+// - - - - - - - - - - - - - - - - - - - - - - - - -
+textarea
+ height: auto
+ width: 100%
+ min-height: 50px
+
+
+// Select menus
+// - - - - - - - - - - - - - - - - - - - - - - - - -
+select
+ $top-padding: get-side($form-padding, top)
+ $bottom-padding: get-side($form-padding, bottom)
+ $height: ($form-fontsize * 1.4) + $top-padding + $bottom-padding
+ $color: is-light($select-background)
+
+ @include no-appearance
+ display: block
+ width: 100%
+ height: $height
+ padding: $form-padding
+ color: $select-color
+ border-radius: 0
+ border: $input-border
+
+ @if $select-arrow
+ background: $select-background url(image-triangle($select-arrow-color)) right 10px center no-repeat
+ background-size: 8px 8px
+ padding-right: rem-calc(18px) + $form-padding
+
+ @else
+ background-color: $select-background
+
+
+ &:hover
+ background-color: $select-background-hover
diff --git a/frontend/src/global_styles/openproject/_index.sass b/frontend/src/global_styles/openproject/_index.sass
index 474366dfa18..857b3e217af 100644
--- a/frontend/src/global_styles/openproject/_index.sass
+++ b/frontend/src/global_styles/openproject/_index.sass
@@ -5,6 +5,7 @@
@import generic
@import base
+@import forms
@import mixins
@import onboarding
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/_global.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/_global.scss
deleted file mode 100755
index afeffb63768..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/_global.scss
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- GLOBAL
- ------
-
- Global styles and settings for Foundation for Apps are stored here. This file must always
- be imported, no matter what.
-
- Includes:
- -
-*/
-
-/// @Foundation.settings
-// Global Styles
-// This sets 1rem to be 16px
-$rem-base: 16px;
-
-// The default font-size is set to 100% of the browser style sheet (usually 16px)
-// for compatibility with browser-based text zoom or user-set defaults.
-
-// Since the typical default browser font-size is 16px, that makes the calculation for grid size.
-// If you want your base font-size to be different and not have it affect the grid breakpoints,
-// set $rem-base to $base-font-size and make sure $base-font-size is a px value.
-$base-font-size: 100% !default;
-
-// $base-line-height is 24px while $base-font-size is 16px
-$base-line-height: 1.5 !default;
-
-// Text selector helpers
-$headers: "h1,h2,h3,h4,h5,h6";
-
-// We use these to define default font weights
-$font-weight-normal: normal !default;
-$font-weight-bold: bold !default;
-
-// We use these to control various global styles
-$body-background: #fff !default;
-$body-font-color: #222 !default;
-$body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
-$body-font-weight: $font-weight-normal !default;
-$body-font-style: normal !default;
-$body-antialiased: true;
-
-// Application Colors
-$primary-color: #00558b !default;
-$secondary-color: #f1f1f1 !default;
-$alert-color: #F04124 !default;
-$info-color: #A0D3E8 !default;
-$success-color: #43AC6A !default;
-$warning-color: #F08A24 !default;
-$dark-color: #232323 !default;
-$gray: #dfdfdf !default;
-$gray-dark: darken($gray, 8) !default;
-$gray-light: lighten($gray, 8) !default;
-
-// We use these to make sure border radius matches unless we want it different.
-$global-radius: 4px !default;
-$global-rounded: 1000px !default;
-
-// We use this for default spacing
-$global-padding: 1rem !default;
-$global-spacing: rem-calc(15) !default;
-///
-
-// For internal use: a color map
-$foundation-colors: (
- primary: $primary-color,
- success: $success-color,
- warning: $warning-color,
- alert: $alert-color,
- dark: $dark-color,
-);
-
-@include exports(global) {
- // Make extra sure we're using the whole window
- html, body {
- height: 100%;
- font-size: $base-font-size;
- }
- // Set box-sizing globally to handle padding and border widths
- html {
- box-sizing: border-box;
- }
- *, *:before, *:after {
- box-sizing: inherit;
- }
-
- // Default body styles
- body {
- background: var(--body-background);
- color: var(--body-font-color);
- padding: 0;
- margin: 0;
- font-family: var(--body-font-family);
- font-weight: $body-font-weight;
- font-style: $body-font-style;
- line-height: 1;
- position: relative;
-
- @if $body-antialiased {
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- }
-
- img {
- // Grid Defaults to get images and embeds to work properly
- max-width: 100%;
- height: auto;
- -ms-interpolation-mode: bicubic;
-
- // Get rid of gap under images by making them display: inline-block; by default
- display: inline-block;
- vertical-align: middle;
- }
-
- // Give all anchors and interactive directives the hover cusor
- a, [ui-sref], [zf-open], [zf-close], [zf-toggle] {
- cursor: pointer;
- }
-
- #map_canvas,
- .map_canvas {
- img,
- embed,
- object { max-width: none !important; }
- }
-
- .padding {
- padding: $global-padding;
- }
-}
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 140c893a199..66060035992 100755
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
@@ -12,6 +12,3 @@ $foundation-version: '1.1.0';
// Helpers
@import "helpers/functions",
"helpers/breakpoints";
-
-// Global styles
-@import "global";