Pracuję nad aplikacją AngularJS z Yeomanem.Ścieżki obrazów dostawcy usługi są nieprawidłowe podczas budowania aplikacji.
Aplikacja zależy od interfejsu użytkownika jQuery, który jest instalowany z Bower. W ten sposób dołączam motyw jQuery UI:
<!-- build:css styles/plugins.css -->
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.core.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.accordion.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.autocomplete.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.button.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.datepicker.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.dialog.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.menu.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.progressbar.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.resizable.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.selectable.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.slider.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.spinner.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.tabs.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.tooltip.css" />
<link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.theme.css" />
<!-- endbuild -->
Podczas tworzenia aplikacji wszystko idzie dobrze, bez błędów.
Jednak w konsoli przeglądarki (przy użyciu Chrome) widzę, że obrazy wymagane przez jQuery UI Datepicker nie mogą zostać znalezione, ponieważ wyglądają wewnątrz styles/images/
i faktycznie są wewnątrz components/...
.
Zrzut
Moim pierwszym pomysłem było zastąpić ścieżki obrazu jQuery UI w CSS, ale nie wydaje się najlepszym rozwiązaniem. Przykład:
Oryginalna stylistyka
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
}
Moje przesłanianie
.ui-widget-header .ui-state-error {
background-image: url(../components/jquery.ui/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png);
}
zalecanych rozwiązań?
To zadziałało dla mnie, modyfikując ścieżki dystrybucji obrazów w "bower_components". –
@Fernando Czy właśnie zmieniłeś katalog stylów na bower_components? – grant
@grant, W moim przypadku skopiowałem wszystkie obrazy w "app/bower_components' do" dist/styles/images'. Ponieważ skonsolidowany CSS znajduje się w 'dist/styles', oznacza to, że odniesienia do' images/someimage' w CSS będą działać w pakiecie dystrybucyjnym. Zobacz [to sedno] (https://gist.github.com/fernandoacorreia/11062046). –