PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.0.3
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.0.3
5.12.1 5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / Plugin / ThemeStyles.php
matomo / app / core / Plugin Last commit date
ConsoleCommand 2 years ago Dimension 2 years ago API.php 2 years ago AggregatedMetric.php 2 years ago ArchivedMetric.php 2 years ago Archiver.php 2 years ago Categories.php 2 years ago ComponentFactory.php 2 years ago ComputedMetric.php 2 years ago ConsoleCommand.php 2 years ago Controller.php 2 years ago ControllerAdmin.php 2 years ago Dependency.php 2 years ago LogTablesProvider.php 2 years ago Manager.php 2 years ago Menu.php 2 years ago MetadataLoader.php 2 years ago Metric.php 2 years ago PluginException.php 2 years ago ProcessedMetric.php 2 years ago ReleaseChannels.php 2 years ago Report.php 2 years ago ReportsProvider.php 2 years ago RequestProcessors.php 2 years ago Segment.php 2 years ago SettingsProvider.php 2 years ago Tasks.php 2 years ago ThemeStyles.php 2 years ago ViewDataTable.php 2 years ago Visualization.php 2 years ago WidgetsProvider.php 2 years ago
ThemeStyles.php
170 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 *
9 */
10 namespace Piwik\Plugin;
11
12 use Piwik\Piwik;
13 class ThemeStyles
14 {
15 // to maintain BC w/ old names that were defined in LESS
16 private static $propertyNamesToLessVariableNames = ['fontFamilyBase' => 'theme-fontFamily-base', 'colorBrand' => 'theme-color-brand', 'colorBrandContrast' => 'theme-color-brand-contrast', 'colorText' => 'theme-color-text', 'colorTextLight' => 'theme-color-text-light', 'colorTextLighter' => 'theme-color-text-lighter', 'colorTextContrast' => 'theme-color-text-contrast', 'colorLink' => 'theme-color-link', 'colorBaseSeries' => 'theme-color-base-series', 'colorHeadlineAlternative' => 'theme-color-headline-alternative', 'colorHeaderBackground' => 'theme-color-header-background', 'colorHeaderText' => 'theme-color-header-text', 'colorMenuContrastText' => 'theme-color-menu-contrast-text', 'colorMenuContrastTextSelected' => 'theme-color-menu-contrast-textSelected', 'colorMenuContrastTextActive' => 'theme-color-menu-contrast-textActive', 'colorMenuContrastBackground' => 'theme-color-menu-contrast-background', 'colorWidgetExportedBackgroundBase' => 'theme-color-widget-exported-background-base', 'colorWidgetTitleText' => 'theme-color-widget-title-text', 'colorWidgetTitleBackground' => 'theme-color-widget-title-background', 'colorBackgroundBase' => 'theme-color-background-base', 'colorBackgroundTinyContrast' => 'theme-color-background-tinyContrast', 'colorBackgroundLowContrast' => 'theme-color-background-lowContrast', 'colorBackgroundContrast' => 'theme-color-background-contrast', 'colorBackgroundHighContrast' => 'theme-color-background-highContrast', 'colorBorder' => 'theme-color-border', 'colorCode' => 'theme-color-code', 'colorCodeBackground' => 'theme-color-code-background', 'colorWidgetBackground' => 'theme-color-widget-background', 'colorWidgetBorder' => 'theme-color-widget-border'];
17 /**
18 * @var string
19 */
20 public $fontFamilyBase = '-apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Cantarell, \'Helvetica Neue\', sans-serif';
21 /**
22 * @var string
23 */
24 public $colorBrand = '#43a047';
25 /**
26 * @var string
27 */
28 public $colorBrandContrast = '#fff';
29 /**
30 * @var string
31 */
32 public $colorText = '#212121';
33 /**
34 * @var string
35 */
36 public $colorTextLight = '#444';
37 /**
38 * @var string
39 */
40 public $colorTextLighter = '#666666';
41 /**
42 * @var string
43 */
44 public $colorTextContrast = '#37474f';
45 /**
46 * @var string
47 */
48 public $colorLink = '#1976D2';
49 /**
50 * @var string
51 */
52 public $colorBaseSeries = '#ee3024';
53 /**
54 * @var string
55 */
56 public $colorHeadlineAlternative = '#4E4E4E';
57 /**
58 * @var string
59 */
60 public $colorHeaderBackground = '#3450A3';
61 /**
62 * @var string
63 */
64 public $colorHeaderText = '#fff';
65 /**
66 * @var string
67 */
68 public $colorMenuContrastText;
69 /**
70 * @var string
71 */
72 public $colorMenuContrastTextSelected;
73 /**
74 * @var string
75 */
76 public $colorMenuContrastTextActive = '#3450A3';
77 /**
78 * @var string
79 */
80 public $colorMenuContrastBackground;
81 /**
82 * @var string
83 */
84 public $colorWidgetExportedBackgroundBase;
85 /**
86 * @var string
87 */
88 public $colorWidgetTitleText;
89 /**
90 * @var string
91 */
92 public $colorWidgetTitleBackground;
93 /**
94 * @var string
95 */
96 public $colorBackgroundBase = '#eff0f1';
97 /**
98 * @var string
99 */
100 public $colorBackgroundTinyContrast = '#f2f2f2';
101 /**
102 * @var string
103 */
104 public $colorBackgroundLowContrast = '#d9d9d9';
105 /**
106 * @var string
107 */
108 public $colorBackgroundContrast = '#fff';
109 /**
110 * @var string
111 */
112 public $colorBackgroundHighContrast = '#202020';
113 /**
114 * @var string
115 */
116 public $colorBorder = '#cccccc';
117 /**
118 * @var string
119 */
120 public $colorCode = '#f3f3f3';
121 /**
122 * @var string
123 */
124 public $colorCodeBackground = '#4d4d4d';
125 /**
126 * @var string
127 */
128 public $colorWidgetBackground;
129 /**
130 * @var string
131 */
132 public $colorWidgetBorder;
133 public function __construct()
134 {
135 $this->colorMenuContrastText = $this->colorText;
136 $this->colorMenuContrastTextSelected = $this->colorMenuContrastText;
137 $this->colorMenuContrastBackground = $this->colorBackgroundContrast;
138 $this->colorWidgetExportedBackgroundBase = $this->colorBackgroundContrast;
139 $this->colorWidgetTitleText = $this->colorText;
140 $this->colorWidgetTitleBackground = $this->colorBackgroundContrast;
141 $this->colorWidgetBackground = $this->colorBackgroundContrast;
142 $this->colorWidgetBorder = $this->colorBackgroundTinyContrast;
143 }
144 /**
145 * @return ThemeStyles
146 */
147 public static function get()
148 {
149 $result = new self();
150 /**
151 * @ignore
152 */
153 Piwik::postEvent('Theme.configureThemeVariables', [$result]);
154 return $result;
155 }
156 public function toLessCode()
157 {
158 $result = '';
159 foreach (get_object_vars($this) as $name => $value) {
160 $varName = isset(self::$propertyNamesToLessVariableNames[$name]) ? self::$propertyNamesToLessVariableNames[$name] : $this->getGenericThemeVarName($name);
161 $result .= "@{$varName}: {$value};\n";
162 }
163 return $result;
164 }
165 private function getGenericThemeVarName($propertyName)
166 {
167 return 'theme-' . $propertyName;
168 }
169 }
170