Search code examples
ruby-on-railsruby-on-rails-3twitter-bootstrapsimple-form

Rails: Twitter Bootstrap Buttons when visited get black text color


I have a rails 3.2 app using Twitter Bootstrap via the gem 'twitter-bootstrap-rails'. Additionally the forms are created with the SimpleForm gem For a number of the pages I've used the twitter buttons on the form via

<%= link_to "Back", :back, :class => 'btn btn-warning'%>
<%= form.button :submit, :class => 'btn btn-primary' %>

The buttons are rendered ok. The issue is that after you select one of the buttons, which visits the link, on returning to the page the text is stuck on the greyed out version as shown below for the 'back' button:

twitter buttons

This causes a problem, especially on the buttons styled with 'btn-primary' as the text is hard to read. An example of this is below:

edit button

Wondering what setting needs to change and where. I expected it should be in the bootstrap_and_overrides.css.less file but not sure what setting to try. Tests on @linkColorHover didn't work.

Any thoughts ?


Solution

  • You could always style the a.btn items, to remove the decorations on the pseudo classes such as :visited