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

Ensure the icon font is loaded only once globally

Oliver Günther144332eb7db8
diff --git a/Gemfile b/Gemfile
index 33c28806d6b..8c409ceb2f3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -98,9 +98,6 @@ gem 'svg-graph', '~> 2.1.0'
gem 'date_validator', '~> 0.9.0'
gem 'ruby-duration', '~> 3.2.0'
-gem 'sassc-rails'
-gem 'livingstyleguide', '~> 2.1.0'
-
# provide compatible filesystem information for available storage
gem 'sys-filesystem', '~> 1.3.3', require: false
@@ -250,6 +247,10 @@ group :development do
gem 'spring-commands-rspec'
gem 'rubocop'
+
+ # Gems for living styleguide
+ gem 'sassc-rails'
+ gem 'livingstyleguide', '~> 2.1.0'
end
group :development, :test do
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 363b3706ce6..d5aa4ef1afb 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -3,8 +3,6 @@ OpenProject::Application.configure do
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
config.assets.precompile += %w(
favicon.ico
- openproject.css
- accessibility.css
admin_users.js
autocompleter.js
copy_issue_actions.js
diff --git a/frontend/src/global_styles/fonts/_index.sass b/frontend/src/global_styles/fonts/_index.sass
index 4855a9da61c..3c6ddd074a3 100644
--- a/frontend/src/global_styles/fonts/_index.sass
+++ b/frontend/src/global_styles/fonts/_index.sass
@@ -1,2 +1,3 @@
@import lato
@import openproject_icon_font
+@import openproject_icon_font_face
diff --git a/frontend/src/global_styles/fonts/_openproject_icon_definitions.scss b/frontend/src/global_styles/fonts/_openproject_icon_definitions.scss
index ce314c7ce99..e563b2924f8 100644
--- a/frontend/src/global_styles/fonts/_openproject_icon_definitions.scss
+++ b/frontend/src/global_styles/fonts/_openproject_icon_definitions.scss
@@ -1,9 +1,3 @@
-@font-face {
- font-family: "openproject-icon-font";
- src: url("~assets/fonts/openproject_icon/openproject-icon-font.woff2") format("woff2"),
- url("~assets/fonts/openproject_icon/openproject-icon-font.woff") format("woff");
-}
-
@mixin icon-mixin-accessibility {
content: "\f101";
}
diff --git a/frontend/src/global_styles/fonts/_openproject_icon_font_face.scss b/frontend/src/global_styles/fonts/_openproject_icon_font_face.scss
new file mode 100644
index 00000000000..dc46ed5fc2b
--- /dev/null
+++ b/frontend/src/global_styles/fonts/_openproject_icon_font_face.scss
@@ -0,0 +1,34 @@
+//-- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2020 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-2017 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 docs/COPYRIGHT.rdoc for more details.
+//++
+
+@font-face {
+ font-family: "openproject-icon-font";
+ src: url("~assets/fonts/openproject_icon/openproject-icon-font.woff2") format("woff2"),
+ url("~assets/fonts/openproject_icon/openproject-icon-font.woff") format("woff");
+}
+
diff --git a/vendor/openproject-icon-font/openproject-icon-font.template.scss b/vendor/openproject-icon-font/openproject-icon-font.template.scss
index 44556c1d2ee..25091f80cb2 100644
--- a/vendor/openproject-icon-font/openproject-icon-font.template.scss
+++ b/vendor/openproject-icon-font/openproject-icon-font.template.scss
@@ -1,9 +1,3 @@
-@font-face {
- font-family: "openproject-icon-font";
- src: url(font-path("openproject_icon/openproject-icon-font.woff2")) format("woff2"),
- url(font-path("openproject_icon/openproject-icon-font.woff")) format("woff");
-}
-
{{#each codepoints}}
@mixin icon-mixin-{{@key}} {
content: "\\{{this}}";