Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved definition of colors in the cookies modal and banner colors to common darkswarm/base/colors #2735

Merged
merged 3 commits into from
Dec 5, 2018

Conversation

luisramos0
Copy link
Contributor

What? Why?

This comes out of this commit from @kristinalim
luisramos0@cdabeda

Instead of having all css files with references to a color palete defined in branding.css we should have a file with all color definitions colors.css and we should use scss variables for colors in the specific css files.

What should we test?

Cookies modal policy page and cookies banner should keep existing colors.

Release notes

Changelog Category: Changed
Introduced new color management approach in CSS.

Dependencies

This started in the cookies engines POC but its now independent from it.

Documentation updates

When this PR is approved we should get this approach documented somewhere on the wiki.

@luisramos0 luisramos0 self-assigned this Sep 17, 2018
@luisramos0
Copy link
Contributor Author

@kristinalim I think this approach with centralised variables for the definition of colors is very good!

I think the only issue in your initial commit is the fact that we have to repeat the variables in two files (branding and colors) so I tried this approach where I import branding.css (with the colors codes) to colors.css and use colors.css to define the element's colors. What do you think about this approach?
Thanks!

@luisramos0 luisramos0 changed the title Moved definition of colors in the cookies modal and banner colors to common darkswarm/bas…e/colors Moved definition of colors in the cookies modal and banner colors to common darkswarm/base/colors Sep 17, 2018
$modal-background-color: #efefef;
$modal-content-background-color: #fff;
$modal-alert-link-color: #fff;
$modal-alert-link-hover-color: rgba(255, 255, 255, .7);

$cookies-banner-background-color: $dark-grey;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also lost with CSS color vars naming but, does this mean we'll have a var for each of $dark-grey uses we'll have? won't we end up with trillions of single-purpose vars?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sauloperez Ideally, we'd keep in mind to extract CSS components when possible. For example, there could be just one set of color assignments in one SCSS partial for general styles used in all modals. So maybe not trillions 😉 but a hundred or so variables.

For the cookies banner though, the color assignments are quite unique, so they would be single-purpose.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean having an SCSS file for each new UI component where we assign the palette vars to component vars? looks good 👍 naming colors vars seems like a very difficult problem for me. I'm struggling with my side project 😓

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, the style I suggested, which is also how @luisramos0 did it in this PR, is to assign the palette vars to component vars in a central file. Each component SCSS partial only uses the component vars.

Good luck with your side project! 😟

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
yes, that central file is this colors.scss file.
if it gets to big, we can move some parts to separate files, as you say, for example, modals_colors.scss

The new convention here is that when you set a color in your component scss, you always set it to a variable like in menu.scss:
li a { color: $menu-mobile-li-a-color; }
instead of
li a { color: rgba(0, 0, 0, 0.9); }
or
li a { color: $dark-grey; }

and then you go to colors.scss to assign this variable $menu-mobile-li-a-color = $dark-grey;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's doc this if the rest of the team agrees.

@kristinalim
Copy link
Member

@luisramos0 Yay! 🙂 I'm happy with this.

The !default values in luisramos0@cdabeda were mostly to allow the domain engines to be independent from the main app. When the domains work is merged, I have no strong opinions about whether to duplicate the color variables in the domain engines (duplication) or have them use the color variables declared in the main app (not exactly independent).

Using !default might indeed be more difficult to maintain... Because you'd need sensible default color assignments in the domain engines, and the final, nicer color assignments in the main app.

@luisramos0
Copy link
Contributor Author

All right! It's kind of a big thing as we agree to go this way from now on. Because of that I am calling for an all-hands code review
@mkllnk @Matt-Yorkley @HugsDaniel are you ok with this?

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the benefit in doing this. Which problem are you trying to solve here?

Having variables that are used once seems to introduce some duplication. And if we want to change cookies-banner to cookies-model we end up renaming everything (shotgun surgery).

If you try to solve the problem that an engine depends on colour definitions of the app then I don't think this is really solving it. Instead of depending on a handful of variables like $dark-grey we then depend on many more variables like $cookie-banner-background-color. That is a bigger surface area for mistakes.

I do see a benefit in having all colours in one place in case we want to introduce a new colour palate. So while I'm not that happy with this change, I wouldn't vote against it if it's really important to you.

@kristinalim
Copy link
Member

@mkllnk Aside from making changing the color scheme easier (rarely needed), and I think this will be a worthwhile effort towards not just using the same colors but using colors in a standard way throughout the website. And during development, IMO this makes dealing with design easier and less intimidating.

Having variables that are used once seems to introduce some duplication. And if we want to change cookies-banner to cookies-model we end up renaming everything (shotgun surgery).

I'm okay with both of these.

If you try to solve the problem that an engine depends on colour definitions of the app then I don't think this is really solving it.

Ah, that part was about using !default in the engines, which @luisramos0 did not include in this PR. 😁 🙊 I myself am no longer convinced it's a good step.

@luisramos0
Copy link
Contributor Author

yep, for me it is not just about making colour changes easier, I like this mostly because it ends the color chaos of this application. or in @kristinalim words "using colors in a standard way throughout the website. And during development"

are you guys aware of variables.css.scss? we have ofn-grey, med-grey and medium-grey, all different...

@mkllnk
Copy link
Member

mkllnk commented Sep 21, 2018

I'm totally for having the style guide colours defined in a central place. I'm just not convinced that we need a variable for every use of a colour. While I do see the point though how a central point of variables can provide an overview of uses and may contribute to resolving the colour chaos. I'm moving this to test ready even though I'm feeling neutral about this change.

@luisramos0
Copy link
Contributor Author

I get your point @mkllnk
I see an alternative to this:

  • we have a central place where we define colours, like the colours.scss file
  • we use the colours directly on the scss files, without variables
  • and we have something like a style guide on the wiki, explaining clearly what colours should be used where

Because the problem is not so much "what colors are used where" but more "what colour should I use in this new component". Sometimes the answer to this last question comes from the UX designer, sometimes the dev just needs to pick a standard color.

Anyway, I think we should go forward. I think this approach will make things better.

@luisramos0
Copy link
Contributor Author

this will conflict with 2521. I am blocking this one as it will be easier to resolve conflicts on this one afterwards.

@Matt-Yorkley
Copy link
Contributor

and we have something like a style guide on the wiki, explaining clearly what colours should be used where

That sounds good!

So we have consensus on keeping all the colour definitions in the same place, but the contentious part is then having a central place where we assign each colour to each component. I think it seems like a good proposal, as long as we don't get carried away with too many component variables, and the ones we have are clearly named. It's nice to see both the definitions of colours as well as clear indications of what they are used for.

$light-grey: #fff;

$modal-border: $light-grey;
$table-border: $light-grey;

So what are the issues people still have, and does anyone have any suggestions to improve it? I can imagine a big file with hundreds of component colour assignments might turn into a mess, maybe some agreed rules on organising the variables for components would be a good idea before we start.

@sauloperez
Copy link
Contributor

I can imagine a big file with hundreds of component colour assignments might turn into a mess

but we can still split them, so that shouldn't be a problem.

@luisramos0
Copy link
Contributor Author

thanks for the feedback @Matt-Yorkley
we can split the files by domain.
also, they will naturally be split by backoffice and frontoffice as the look and feel is very different.

@daniellemoorhead
Copy link
Contributor

this will conflict with 2521. I am blocking this one as it will be easier to resolve conflicts on this one afterwards.

#2521 is now in the ready to go column @luisramos0, so can this PR be considered unblocked and you can resolve the conflicts (I assume the conflicts are that people don't necessarily agree with the approach as opposed to build conflicts? 😃 ) and get this finalised?

@luisramos0
Copy link
Contributor Author

It's build conflicts @daniellemoorhead . I can resolve them after 2521 is merged.

@sigmundpetersen
Copy link
Contributor

2521 merged @luisramos0

@luisramos0 luisramos0 force-pushed the cookies_colors branch 2 times, most recently from a95a7b4 to d7c4a7d Compare October 15, 2018 12:56
@luisramos0
Copy link
Contributor Author

conflicts resolved. ready for testing now.

@Matt-Yorkley Matt-Yorkley added the pr-staged-uk staging.openfoodnetwork.org.uk label Oct 15, 2018
@Matt-Yorkley
Copy link
Contributor

Staged on: https://staging.openfoodnetwork.org.uk

@RachL RachL self-assigned this Oct 17, 2018
@RachL
Copy link
Contributor

RachL commented Oct 17, 2018

@luisramos0 the cookie policy modal cannot be opened on staging UK. It's working on production. Could it be linked to this PR? (tested both on Firefox and Chrome icognito version)

Testing notes : https://docs.google.com/document/d/1ZhKbkXcgF_yY0gZbQkwSIYEPVxETX1sTK3c5rmGsGCQ/edit#

@luisramos0
Copy link
Contributor Author

ok @RachL , thanks for testing!

I have to say....

just kidding (but it's true).

I think I spotted an error that could be causing this issue.
Initially I called the engine "content" and run bundle install, later I renamed it to "web" but I didnt run bundle install again. That's why the web dependency is in the wrong place. The fix is to run bundle install again (that's why the fix also appears here).

This may not be the cause of the test error. Let's see.

I have rebased this PR and included the fix on it.
@Matt-Yorkley could you please re-stage?

The test afterwards is just to try access this url, it should work:
https://staging.openfoodnetwork.org.uk/angular-templates/cookies_policy.html
If this works, you can retest @RachL
If it doesn't work, I've to look again.

@RachL RachL removed the pr-staged-uk staging.openfoodnetwork.org.uk label Oct 19, 2018
@sigmundpetersen
Copy link
Contributor

Ping @Matt-Yorkley do you want to stage this again on UK?

@mkllnk
Copy link
Member

mkllnk commented Nov 2, 2018

Trying to deploy this, asset compilation failed. It's directly related to this pull request:

bundle exec rake assets:precompile:primary RAILS_GROUPS=assets RAILS_ENV=staging
rake aborted!
Sass::SyntaxError: File to import not found or unreadable: ../branding.
Load paths:
  Sass::Rails::Importer(/home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/all.css.scss)
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation/components
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation
  /home/openfoodnetwork/apps/openfoodnetwork/current/app/assets/stylesheets
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/compass-core-1.0.3/stylesheets
  Compass::SpriteImporter
  (in /home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/all.css.scss)
/home/openfoodnetwork/apps/openfoodnetwork/current/app/assets/stylesheets/darkswarm/base/colors.css.scss:1
/home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/pages/cookies_banner.css.scss:1
/home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/all.css.scss:1
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:66:in `rescue in import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:45:in `import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:28:in `imported_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:37:in `css_import?'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:283:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block (2 levels) in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `block in with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:294:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block (2 levels) in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `block in with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:294:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:161:in `block in visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:173:in `with_environment'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:160:in `visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:180:in `visit_root'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:151:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:8:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/root_node.rb:36:in `css_tree'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/root_node.rb:20:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/engine.rb:274:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-rails-3.2.6/lib/sass/rails/template_handlers.rb:106:in `evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:193:in `block in evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/sprockets/unprocessed_asset.rb:24:in `initialize'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `new'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:270:in `circular_call_protection'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:14:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:93:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:92:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:169:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/bundled_asset.rb:12:in `initialize'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `new'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:93:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:92:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:169:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:32:in `block in compile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:219:in `block in each_logical_path'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each_entry'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:204:in `block in each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:217:in `each_logical_path'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:29:in `compile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:102:in `internal_precompile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:119:in `block (3 levels) in <top (required)>'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/bugsnag-4.1.0/lib/bugsnag/rake.rb:12:in `execute_with_bugsnag'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/openfoodnetwork/.rbenv/versions/2.1.5/bin/bundle:23:in `load'
/home/openfoodnetwork/.rbenv/versions/2.1.5/bin/bundle:23:in `<main>'

Caused by:
Sass::SyntaxError: File to import not found or unreadable: ../branding.
Load paths:
  Sass::Rails::Importer(/home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/all.css.scss)
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation/components
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/foundation-rails-5.5.0.0/vendor/assets/stylesheets/foundation
  /home/openfoodnetwork/apps/openfoodnetwork/current/app/assets/stylesheets
  /home/openfoodnetwork/.gem/ruby/2.1.0/gems/compass-core-1.0.3/stylesheets
  Compass::SpriteImporter
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:64:in `import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:28:in `imported_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/import_node.rb:37:in `css_import?'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:283:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block (2 levels) in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `block in with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:294:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block (2 levels) in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:297:in `block in visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `block in with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:88:in `with_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:294:in `visit_import'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `block in with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:121:in `with_frame'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/stack.rb:79:in `with_base'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:152:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `map'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:161:in `block in visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:173:in `with_environment'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:160:in `visit_children'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:180:in `visit_root'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:151:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/visitors/perform.rb:8:in `visit'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/root_node.rb:36:in `css_tree'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/tree/root_node.rb:20:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-3.3.14/lib/sass/engine.rb:274:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sass-rails-3.2.6/lib/sass/rails/template_handlers.rb:106:in `evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:193:in `block in evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/context.rb:190:in `evaluate'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/sprockets/unprocessed_asset.rb:24:in `initialize'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `new'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:16:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:270:in `circular_call_protection'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:14:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:93:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:92:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:169:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/bundled_asset.rb:12:in `initialize'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `new'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/base.rb:22:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:93:in `block in build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/caching.rb:19:in `cache_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/index.rb:92:in `build_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:169:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/index.rb:14:in `find_asset'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:32:in `block in compile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:219:in `block in each_logical_path'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:196:in `each_entry'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:204:in `block in each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:203:in `each_file'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/sprockets-2.2.3/lib/sprockets/base.rb:217:in `each_logical_path'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/sprockets_overrides/static_compiler.rb:29:in `compile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:102:in `internal_precompile'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/tasks/assets.rake:119:in `block (3 levels) in <top (required)>'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/bugsnag-4.1.0/lib/bugsnag/rake.rb:12:in `execute_with_bugsnag'
/home/openfoodnetwork/.gem/ruby/2.1.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/openfoodnetwork/.rbenv/versions/2.1.5/bin/bundle:23:in `load'
/home/openfoodnetwork/.rbenv/versions/2.1.5/bin/bundle:23:in `<main>'
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)

@mkllnk
Copy link
Member

mkllnk commented Nov 23, 2018

@luisramos0 This has been in dev for three weeks. What's your plan?

@luisramos0
Copy link
Contributor Author

I'll fix this soon.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Nov 29, 2018

From the error message:

Sass::SyntaxError: File to import not found or unreadable: ../branding.
Load paths: Sass::Rails::Importer(/home/openfoodnetwork/apps/openfoodnetwork/current/engines/web/app/assets/stylesheets/web/all.css.scss)

we can see there must be a problem with versions as there is no ../branding in web/all.css.scss (it used to be!)
So, I have simply rebased this PR and we should try to restage when a staging server is available.

@luisramos0
Copy link
Contributor Author

There's another option which is that when darkswarm/base/colors gets imported into web/pages/cookies_banner, it comes with a @import '../branding'; that is not well resolved in the engines context. Must be that. I'll give it a try now.

@luisramos0 luisramos0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Nov 29, 2018
…nce so that colors can be imported in engines
@luisramos0
Copy link
Contributor Author

Second option was correct, fixed relative reference with extra commit and now I could deploy with no errors in UK staging. Ready for Testing.

@RachL
Copy link
Contributor

RachL commented Dec 4, 2018

All good! I've updated the testing notes:

https://docs.google.com/document/d/1ZhKbkXcgF_yY0gZbQkwSIYEPVxETX1sTK3c5rmGsGCQ/edit#

@RachL RachL removed the pr-staged-uk staging.openfoodnetwork.org.uk label Dec 4, 2018
@sauloperez sauloperez merged commit e5a267f into openfoodfoundation:master Dec 5, 2018
@luisramos0 luisramos0 deleted the cookies_colors branch December 5, 2018 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants