protected function writeCSS($file, $links) {
$res = array();
+ $lessContents = '';
+
$lessVariables = array();
$lessVariables['slider-display'] = $this->_lessBoolean($this->theme->parametres->pagesBar);
$lessVariables['slider-thumb-background'] = wsHTML5::colorToCSS($this->theme->parametres->pageBarThumbBack);
$res[] = $shade;
// SVG
-
$res[] = 'svg .fill-c-menu-back{fill:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
$res[] = 'svg .fill-c-menu-text{fill:' . wsHTML5::colorToCSS($this->theme->parametres->subTextColor) . ';}';
-
// Background
$res[] = $this->_cssBackground();
$lessVariables['icon-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurI);
$lessVariables['menu-overlay'] = wsHTML5::colorToCSS($this->theme->parametres->popupVideoOverlay);
+ // Chapters
+
+
+ foreach ($this->book->chapters as $chapter) {
+ if (substr($chapter->page, 0, 1) != '#') {
+ continue;
+ }
+ if ($chapter->color == '') {
+ continue;
+ }
+ $color = trim($chapter->color, '#');
+ $lessContents .= '.mview.c_' . $color . '{.menu-color(#' . $color . ');}';
+ }
+
// Archives
if ($this->book->parametres->externalArchivesBack) {
$this->vdir->copy($this->wdir . '/' . $this->book->parametres->externalArchivesBack, 'data/images/' . $this->book->parametres->externalArchivesBack);
$res[] = '.zoomPopupClose {background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
- $this->_writeLess($lessVariables);
+ $this->_writeLess($lessVariables, $lessContents);
$res = array_chunk($res, 3500);
foreach ($res as $k => $css) {
return count($res);
}
- protected function _writeLess($variables) {
+ protected function _writeLess($variables, $lessContents = '') {
if ($this->widget) {
$this->lessFiles[] = 'widget';
}
$bookVariables[] = '@' . trim($k) . ':' . $v . ';';
}
file_put_contents($tmp . '/book-variables.less', implode("\n", $bookVariables));
+ file_put_contents($tmp . '/additional.less', $lessContents);
foreach ($this->lessFiles as $f) {
-
$source_less = $this->assets . '/style/' . $f . '.less';
$destination_less = $tmp . '/' . $f . '.less';
$destination_css = $tmp . '/' . $f . '.css';