DEV: Move color definition functions to mixins (#12511)

This commit is contained in:
Penar Musaraj
2021-03-24 18:35:52 -04:00
committed by GitHub
parent fa9b9be01f
commit e4f3a04d53
3 changed files with 24 additions and 20 deletions

View File

@ -77,7 +77,7 @@ describe Stylesheet::Importer do
context "#import_color_definitions" do
let(:scss) { ":root{--custom-color: green}" }
let(:scss_child) { ":root{--custom-color: red}" }
let(:scss_child) { "$navy: #000080; :root{--custom-color: red; --custom-color-rgb: \#{hexToRGB($navy)}}" }
let(:theme) do
Fabricate(:theme).tap do |t|
@ -101,8 +101,10 @@ describe Stylesheet::Importer do
theme.save!
styles = Stylesheet::Importer.new({ theme_id: theme.id }).import_color_definitions
expect(styles).to include(scss_child)
expect(styles).to include("Color definitions from Child Theme")
expect(styles).to include("--custom-color: red")
expect(styles).to include("--custom-color-rgb: 0,0,128")
end
it "should include default theme color definitions" do