sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

White exclamation mark on white background on error #1560

Closed tautrimas closed 10 years ago

tautrimas commented 11 years ago

We noticed, that after submission of incorrect form, exclamation mark ("!") icon is shown on related form tab. Unfortunately, if the tab is active, icon is shown in white on white background.

Upstream discussion for this bug including work-around https://github.com/twbs/bootstrap/issues/4523

Commit fixing this bug https://github.com/twbs/bootstrap/pull/4993 (2.1.2 was released as 2.2.0).

We should update Twitter Bootstrap to 2.2.0.

tautrimas commented 11 years ago

Update: it seems that SonataAdminBundle already tries to override exclamation icon by

// sonata-project/admin-bundle/Sonata/AdminBundle/Resources/public/bootstrap/css/bootstrap.css
.sonata-bc [class^="icon-"],
.sonata-bc [class*=" icon-"] {
  display: inline-block;
  width: 14px;
  height: 14px;
  *margin-right: .3em;
  line-height: 14px;
  vertical-align: text-top;
  background-image: url("../img/glyphicons-halflings.png");
  background-position: 14px 14px;
  background-repeat: no-repeat;
  margin-top: 1px;
}

Unfortunatelly, this gets overriden by

/* White icons with optional class, or on hover/active states of certain elements */
.sonata-bc .icon-white,
.sonata-bc .nav > .active > a > [class^="icon-"],
.sonata-bc .nav > .active > a > [class*=" icon-"],
.sonata-bc .dropdown-menu > li > a:hover > [class^="icon-"],
.sonata-bc .dropdown-menu > li > a:hover > [class*=" icon-"],
.sonata-bc .dropdown-menu > .active > a > [class^="icon-"],
.sonata-bc .dropdown-menu > .active > a > [class*=" icon-"] {
  background-image: url("../img/glyphicons-halflings-white.png");
}

So the current workaround is to use separate CSS with contents of:

ul.nav-tabs > li.active > a > [class^="icon-"], ul.nav-tabs > li.active > a > [class*=" icon-"] {
    background-image: url("../../sonataadmin/bootstrap/img/glyphicons-halflings.png") !important;
}
pulzarraider commented 10 years ago

@tautrimas Thank you for reporting the issue. The problem should be fixed in branch 2.3 (using new bootstrap), the missing icon was added in PR #2488