Ensure the icon font is loaded only once globally

If we do not ensure this, components will double load the font,
resulting in 404 font requests and breaking travis
pull/8484/head
Oliver Günther 4 years ago
parent c0e3516b50
commit 144332eb7d
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 7
      Gemfile
  2. 2
      config/initializers/assets.rb
  3. 1
      frontend/src/global_styles/fonts/_index.sass
  4. 6
      frontend/src/global_styles/fonts/_openproject_icon_definitions.scss
  5. 34
      frontend/src/global_styles/fonts/_openproject_icon_font_face.scss
  6. 6
      vendor/openproject-icon-font/openproject-icon-font.template.scss

@ -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

@ -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

@ -1,2 +1,3 @@
@import lato
@import openproject_icon_font
@import openproject_icon_font_face

@ -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";
}

@ -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");
}

@ -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}}";

Loading…
Cancel
Save