mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 21:56:33 +08:00
DEV: Cleanup variables/mixins SCSS imports (#11618)
Prepends variables.scss and mixins.scss globally for all assets. With one notable exception, theme fields, which will be addressed in a separate PR.
This commit is contained in:
parent
f6b9691ed7
commit
5f846531a5
@ -2,8 +2,6 @@
|
||||
// It is compiled to CSS separately from the rest of the app.
|
||||
// The source variables come from color_transformations.scss and variables.scss
|
||||
|
||||
@import "common/foundation/variables";
|
||||
|
||||
// this converts HEX colors to RGBs so they can be used in vanilla CSS
|
||||
// i.e.: rgba(var(--primary-low-rgb), 0.5)
|
||||
//
|
||||
|
@ -4,8 +4,6 @@
|
||||
@import "vendor/pikaday";
|
||||
@import "common/foundation/helpers";
|
||||
@import "common/foundation/base";
|
||||
@import "common/foundation/mixins";
|
||||
@import "common/foundation/variables";
|
||||
@import "common/select-kit/_index";
|
||||
@import "common/components/_index";
|
||||
@import "common/input_tip";
|
||||
|
@ -1,7 +1,5 @@
|
||||
// Styles for /admin section
|
||||
|
||||
@import "common/foundation/variables";
|
||||
@import "common/foundation/mixins";
|
||||
@import "common/foundation/helpers";
|
||||
|
||||
$mobile-breakpoint: 700px;
|
||||
|
@ -1,6 +1,3 @@
|
||||
@import "./variables";
|
||||
@import "./mixins";
|
||||
|
||||
// --------------------------------------------------
|
||||
// Base styles for HTML elements
|
||||
// --------------------------------------------------
|
||||
|
@ -1,6 +1,3 @@
|
||||
@import "foundation/variables";
|
||||
@import "foundation/mixins";
|
||||
|
||||
.popup-tip {
|
||||
position: absolute;
|
||||
display: block;
|
||||
|
@ -2,9 +2,7 @@
|
||||
@import "./vendor/normalize";
|
||||
@import "./vendor/normalize-ext";
|
||||
@import "./common/foundation/base";
|
||||
@import "./common/foundation/variables";
|
||||
@import "./color_definitions";
|
||||
@import "./common/foundation/mixins";
|
||||
@import "./common/components/buttons";
|
||||
|
||||
article.post {
|
||||
|
3
app/assets/stylesheets/vendor/pikaday.scss
vendored
3
app/assets/stylesheets/vendor/pikaday.scss
vendored
@ -1,6 +1,3 @@
|
||||
@import "common/foundation/variables";
|
||||
@import "common/foundation/mixins";
|
||||
|
||||
/*!
|
||||
* Pikaday
|
||||
* Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
|
||||
|
@ -3,8 +3,6 @@
|
||||
@import "vendor/normalize";
|
||||
@import "vendor/normalize-ext";
|
||||
@import "common/foundation/colors";
|
||||
@import "common/foundation/variables";
|
||||
@import "common/foundation/mixins";
|
||||
@import "common/select-kit/_index";
|
||||
@import "common/components/svg";
|
||||
@import "common/base/modal";
|
||||
|
@ -9,16 +9,16 @@ module Stylesheet
|
||||
class Compiler
|
||||
|
||||
def self.compile_asset(asset, options = {})
|
||||
file = "@import \"common/foundation/variables\"; @import \"common/foundation/mixins\";"
|
||||
|
||||
if Importer.special_imports[asset.to_s]
|
||||
filename = "theme_#{options[:theme_id]}.scss"
|
||||
file = "@import \"common/foundation/variables\"; @import \"common/foundation/mixins\";"
|
||||
file += " @import \"theme_variables\";" if Importer::THEME_TARGETS.include?(asset.to_s)
|
||||
file += " @import \"#{asset}\";"
|
||||
else
|
||||
filename = "#{asset}.scss"
|
||||
path = "#{Stylesheet::Common::ASSET_ROOT}/#{filename}"
|
||||
file = File.read path
|
||||
file += File.read path
|
||||
|
||||
if asset.to_s == Stylesheet::Manager::COLOR_SCHEME_STYLESHEET
|
||||
file += Stylesheet::Importer.import_color_definitions(options[:theme_id])
|
||||
|
Loading…
x
Reference in New Issue
Block a user