24 private $bibliographyOptions;
29 private $cssRules =
null;
37 $this->bibliographyOptions = $bibliographyOptions;
48 return implode(
"\n", $this->cssRules->toArray());
54 private function init()
56 $lineSpacing = $this->bibliographyOptions->getLineSpacing();
57 $entrySpacing = $this->bibliographyOptions->getEntrySpacing();
58 $hangingIndent = $this->bibliographyOptions->getHangingIndent();
60 if ($lineSpacing || $entrySpacing || $hangingIndent) {
61 $rule = $this->cssRules->getRule(
".csl-entry");
62 if (!empty($lineSpacing)) {
63 $rule->addDirective(
"line-height", intval($lineSpacing) .
"em");
66 if (!empty($entrySpacing)) {
67 $rule->addDirective(
"margin-bottom", intval($entrySpacing) .
"em");
70 if (!empty($hangingIndent)) {
71 $rule->addDirective(
"padding-left",
"2em");
72 $rule->addDirective(
"text-indent",
"-2em");
76 if (
"flush" === $this->bibliographyOptions->getSecondFieldAlign()) {
77 $rule = $this->cssRules->getRule(
".csl-left-margin");
78 $rule->addDirective(
"display",
"block");
79 $rule->addDirective(
"float",
"left");
81 $rule = $this->cssRules->getRule(
".csl-right-inline");
82 $rule->addDirective(
"margin-left",
"35px");