//  Copyright (c) 2012-2022, Jungwacht Blauring Schweiz. This file is part of
//  hitobito and licensed under the Affero General Public License version 3
//  or later. See the COPYING file at the top-level directory or at
//  https://github.com/hitobito/hitobito.

/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*/

<% include ActionView::Helpers %>
<% include Webpacker::Helper %>
<% include WebpackHelper %>

/**
* Variables
*/

// Can be configured in config/settings.yml
$logo-width: <%= Settings.application.logo.width %>px !default;
$logo-height: <%= Settings.application.logo.height %>px !default;
$logo-background-color: <%= Settings.application.logo.background_color %> !default;
<% if Settings.application.page_background.try(ENV['RAILS_HOST_NAME'] || "dev") %>
  $page-background: <%= Settings.application.page_background.send(ENV['RAILS_HOST_NAME']  || "dev") %>;
<% end %>

// Import the wagons' specific variables or fall back to core variables
<% absolute_wagon_file_paths(
  File.join('app', 'assets', 'stylesheets', 'hitobito', 'customizable', '_variables.scss'),
  File.join('..', 'stylesheets', 'hitobito', 'customizable', '_variables.scss')
  ) do |file_path| %>
  @import "<%= file_path %>";
<% end %>

/**
* SASS Mixins
*/
@import "../stylesheets/hitobito/media-queries";

/**
* Bootstrap utilities customization
*/
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/utilities";
@import "../stylesheets/hitobito/utilities";
@import "../stylesheets/hitobito/customizable/utilities";

/**
* Dependencies
*/
@import "~@fortawesome/fontawesome-free/css/all";
@import "bootstrap/scss/bootstrap";

/**
 * Core styles
 */
@import "../stylesheets/hitobito/main";
@import "../stylesheets/hitobito/modal";
@import "../stylesheets/hitobito/help-texts";

@import "../stylesheets/hitobito/oauth-dialog";

/**
 * Wagon styles
 */
// Import the wagons' fonts or fall back to core fonts
<% absolute_wagon_file_paths(
     File.join('app', 'assets', 'stylesheets', 'hitobito', 'customizable', '_fonts.scss'),
     File.join('..', 'stylesheets', 'hitobito', 'customizable', '_fonts.scss')
) do |file_path| %>
  @import "<%= file_path %>";
<% end %>

// Import the wagons' styles
<% absolute_wagon_file_paths(
     File.join('app', 'assets', 'stylesheets', 'hitobito', 'customizable', '_wagon.scss')
  ) do |file_path| %>
  @import "<%= file_path %>";
<% end %>
