Comments (7)
Thanks Dennis.
I don't see anything wrong with your css -- but the background-position might not be fully proper (mixing percent and pixels has caused me trouble before -- but I haven't seen it in a while).. I'd check on that first. I'm guessing there's nothing wrong with the css that Mercury's using because it's being generated by Sass (so I doubt a missing semi-colon would matter).
Hopefully you've already resolved it, but maybe that'll help?
from mercury.
Had to modify toolbar.css under mercury gem's vendor assets to be able to show the background image in safari.
I just noticed this.. what did you have to change? I'll try and make it more flexible if you have any suggestions.
from mercury.
I added the same:
.mercury-primary-toolbar .mercury-close-button em, .mercury-expander-button[data-button="close"] em {
background-image:url('/assets/close_button.png');
background-position: 50% 2px !important;
}
to toolbar.css, right where the rest of them are.
For some reason, any styles applied on those elements (toolbar) at that level of specificity (even with important) in another file, don't show up (I've only tested with chrome and safari, and only safari behaves this way).
To work around this, we wound up removing mercury stylesheet from the assets, and replaced it with copy/paste of the contents of mercury.css from web inspector once the page was loaded. Now everything works as expected in both browsers.
I don't really have any suggestions, as this doesn't make sense to me. Why would chrome allow me to add the style, and safari would not (both would show the proper style being in a stylesheet loaded via asset pipeline)? But safari would not show the style (even as overridden) in the web inspector.
I don't feel I have enough knowledge to blame anything in particular :)
Also, have you tried using jquery-ui from the jquery-rails gem via asset pipeline in a project with mercury? I'm down to tossing jquery-ui in public and loading it in via a script tag where needed, and I don't know if it's a configuration issue on my side. Again, the browser's web inspector shows the jquery-ui file as being downloaded, and linked in the page as a script tag, after jquery... but, while I was able to use .dialog(), I could not use .slider().
Anyway, we're plugging away and have worked around any issues for now, just wanted to inform you. Again, I haven't spent the effort in actually tracking down 'the' issue, so it might have nothing to do with mercury.
Dennis
from mercury.
Fair enough. I'll look into this further.
On Sep 26, 2011, at 9:11 AM, [email protected] wrote:
I added the same:
.mercury-primary-toolbar .mercury-close-button em, .mercury-expander-button[data-button="close"] em {
background-image:url('/assets/close_button.png');
background-position: 50% 2px !important;
}to toolbar.css, right where the rest of them are.
For some reason, any styles applied on those elements (toolbar) at that level of specificity (even with important) in another file, don't show up (I've only tested with chrome and safari, and only safari behaves this way).
To work around this, we wound up removing mercury stylesheet from the assets, and replaced it with copy/paste of the contents of mercury.css from web inspector once the page was loaded. Now everything works as expected in both browsers.
I don't really have any suggestions, as this doesn't make sense to me. Why would chrome allow me to add the style, and safari would not (both would show the proper style being in a stylesheet loaded via asset pipeline)? But safari would not show the style (even as overridden) in the web inspector.
I don't feel I have enough knowledge to blame anything in particular :)
Also, have you tried using jquery-ui from the jquery-rails gem via asset pipeline in a project with mercury? I'm down to tossing jquery-ui in public and loading it in via a script tag where needed, and I don't know if it's a configuration issue on my side. Again, the browser's web inspector shows the jquery-ui file as being downloaded, and linked in the page as a script tag, after jquery... but, while I was able to use .dialog(), I could not use .slider().
Anyway, we're plugging away and have worked around any issues for now, just wanted to inform you. Again, I haven't spent the effort in actually tracking down 'the' issue, so it might have nothing to do with mercury.
Dennis
Reply to this email directly or view it on GitHub:
#20 (comment)
from mercury.
A workaround for overriding/customizing the default mercury stylesheets (toolbar, etc):
Create app/assets/stylesheets/mercury.css with:
//= require mercury/mercury
//= require your_custom_mercury_files
I had to rm -rf tmp/sass-cache tmp/assets and restart the server.
from mercury.
I added a commit tonight that should make this easier in the future.. If you're using the Rails engine, and run
rails g mercury:install
You will now have the option to install the layout and an overrides css file (you can do it without being prompted if you use the -f or --full option on the generator. You can make whatever changes you may need in these files.
It should be noted, that the overrides file is really only intended for the mercury layout, so if you're using 'require_tree .' in your application.css the styles will be included in your views, which may not be desirable.
from mercury.
Hopefully that will give some clarification on how to approach it.
from mercury.
Related Issues (20)
- Routes method is patch, can we do it?
- Is mercury stopped since 2013 dec? HOT 2
- How to prevent loading mercury.js on all pages?
- Paste image from clipboard
- Can we use mecury editor as docx editing tool ? HOT 1
- mercury editor blank page in heroku HOT 1
- Mercury2 normal html example ?
- Snippets with javascripts included HOT 1
- Snippet options not saved correctly [$15]
- Mercury2 on HTML
- Uncaught TypeError: Cannot read property 'stylesheets' of undefined
- /usr/local/rvm/gems/ruby-2.3.0/gems/actionpack-4.2.5/lib/action_dispatch/routing/mapper.rb:238:in `add_request_method': You should not use the `match` method in your router without specifying an HTTP method. (ArgumentError)
- 34324
- bundler 1.13.1 objects to git protocol
- Section: Rails support in Readme.md? HOT 1
- How to remove mercury? HOT 1
- Neither install or post_install are working in Rails 5.2 HOT 2
- Regular Expression DoS vulnerability
- Mercury failed to load Live www.domain.com HOT 1
- Mode Set is closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mercury.