22
33namespace Demyanovs \PHPHighlight ;
44
5+ use Demyanovs \PHPHighlight \Themes \Styles ;
56use Demyanovs \PHPHighlight \Themes \Theme ;
67
78class Highlighter
@@ -75,12 +76,12 @@ private function wrapCode(string $text, string $bgColor = '', string $filePath =
7576 $ wrapper = '<div class="code-block-wrapper"> ' ;
7677 if ($ this ->_showActionPanel ) {
7778 $ wrapper .= '
78- <div class="meta">
79- <div class="actions">
80- <span class="js-copy-clipboard copy-text" onclick="PHPHighlight.copyClipboard(this)">copy</span>
81- <span class="meta-divider"></span>
79+ <div class="meta" style=" ' . Styles:: getCodeBlockWrapperMetaStyle () . ' " >
80+ <div class="actions" style=" ' . Styles:: getCodeBlockWrapperActionsStyle () . ' " >
81+ <span class="js-copy-clipboard copy-text" style=" ' . Styles:: getCodeBlockWrapperCopyTextStyle () . ' " onclick="PHPHighlight.copyClipboard(this)">copy</span>
82+ <span class="meta-divider" style=" ' . Styles:: getCodeBlockWrapperMetaDividerStyle () . ' " ></span>
8283 </div>
83- <div class="info">
84+ <div class="info" style=" ' . Styles:: getCodeBlockWrapperInfoStyle () . ' " >
8485 <span> ' . $ filePath . '</span>
8586 </div>
8687 </div> ' ;
@@ -91,7 +92,7 @@ private function wrapCode(string $text, string $bgColor = '', string $filePath =
9192 if ($ this ->_showLineNumbers ) {
9293 $ line_numbers = $ this ->setLineNumbers (count (explode (PHP_EOL , $ text )));
9394 }
94- $ wrapper .= '<div class="code-highlighter" style="background-color: ' . $ bgColor . '"> ' . $ line_numbers . '<div class="code-block"> ' . $ text . '</div></div></div> ' ;
95+ $ wrapper .= '<div class="code-highlighter" style=" ' . Styles:: getCodeHighlighterStyle () . ' ; background-color: ' . $ bgColor . '"> ' . $ line_numbers . '<div class="code-block"> ' . $ text . '</div></div></div> ' ;
9596
9697 return $ wrapper ;
9798 }
@@ -100,10 +101,10 @@ private function setLineNumbers(int $count) : string
100101 {
101102 $ line_numbers = '' ;
102103 for ($ i = 1 ; $ i < $ count +1 ; $ i ++) {
103- $ line_numbers .= '<span class="line-number" style="color: ' . $ this ->_theme ::getDefaultColor () . '"> ' . $ i . '</span> ' ;
104+ $ line_numbers .= '<span class="line-number" style=" ' . Styles:: getLineNumberStyle () . ' ; color: ' . $ this ->_theme ::getDefaultColor () . '"> ' . $ i . '</span> ' ;
104105 }
105106
106- return '<div class="line-numbers"> ' . $ line_numbers . '</div> ' ;
107+ return '<div class="line-numbers" style=" ' . Styles:: getLineNumbersStyle () . ' " > ' . $ line_numbers . '</div> ' ;
107108 }
108109
109110 public function setShowActionPanel (bool $ status ) : void
0 commit comments