PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.1.4
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.1.4
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
169 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\Plugin;
10
11 use Piwik\Piwik;
12 class ThemeStyles
13 {
14 // to maintain BC w/ old names that were defined in LESS
15 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'];
16 /**
17 * @var string
18 */
19 public $fontFamilyBase = '-apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Cantarell, \'Helvetica Neue\', sans-serif';
20 /**
21 * @var string
22 */
23 public $colorBrand = '#43a047';
24 /**
25 * @var string
26 */
27 public $colorBrandContrast = '#fff';
28 /**
29 * @var string
30 */
31 public $colorText = '#212121';
32 /**
33 * @var string
34 */
35 public $colorTextLight = '#444';
36 /**
37 * @var string
38 */
39 public $colorTextLighter = '#666666';
40 /**
41 * @var string
42 */
43 public $colorTextContrast = '#37474f';
44 /**
45 * @var string
46 */
47 public $colorLink = '#1976D2';
48 /**
49 * @var string
50 */
51 public $colorBaseSeries = '#ee3024';
52 /**
53 * @var string
54 */
55 public $colorHeadlineAlternative = '#4E4E4E';
56 /**
57 * @var string
58 */
59 public $colorHeaderBackground = '#3450A3';
60 /**
61 * @var string
62 */
63 public $colorHeaderText = '#fff';
64 /**
65 * @var string
66 */
67 public $colorMenuContrastText;
68 /**
69 * @var string
70 */
71 public $colorMenuContrastTextSelected;
72 /**
73 * @var string
74 */
75 public $colorMenuContrastTextActive = '#3450A3';
76 /**
77 * @var string
78 */
79 public $colorMenuContrastBackground;
80 /**
81 * @var string
82 */
83 public $colorWidgetExportedBackgroundBase;
84 /**
85 * @var string
86 */
87 public $colorWidgetTitleText;
88 /**
89 * @var string
90 */
91 public $colorWidgetTitleBackground;
92 /**
93 * @var string
94 */
95 public $colorBackgroundBase = '#eff0f1';
96 /**
97 * @var string
98 */
99 public $colorBackgroundTinyContrast = '#f2f2f2';
100 /**
101 * @var string
102 */
103 public $colorBackgroundLowContrast = '#d9d9d9';
104 /**
105 * @var string
106 */
107 public $colorBackgroundContrast = '#fff';
108 /**
109 * @var string
110 */
111 public $colorBackgroundHighContrast = '#202020';
112 /**
113 * @var string
114 */
115 public $colorBorder = '#cccccc';
116 /**
117 * @var string
118 */
119 public $colorCode = '#f3f3f3';
120 /**
121 * @var string
122 */
123 public $colorCodeBackground = '#4d4d4d';
124 /**
125 * @var string
126 */
127 public $colorWidgetBackground;
128 /**
129 * @var string
130 */
131 public $colorWidgetBorder;
132 public function __construct()
133 {
134 $this->colorMenuContrastText = $this->colorText;
135 $this->colorMenuContrastTextSelected = $this->colorMenuContrastText;
136 $this->colorMenuContrastBackground = $this->colorBackgroundContrast;
137 $this->colorWidgetExportedBackgroundBase = $this->colorBackgroundContrast;
138 $this->colorWidgetTitleText = $this->colorText;
139 $this->colorWidgetTitleBackground = $this->colorBackgroundContrast;
140 $this->colorWidgetBackground = $this->colorBackgroundContrast;
141 $this->colorWidgetBorder = $this->colorBackgroundTinyContrast;
142 }
143 /**
144 * @return ThemeStyles
145 */
146 public static function get()
147 {
148 $result = new self();
149 /**
150 * @ignore
151 */
152 Piwik::postEvent('Theme.configureThemeVariables', [$result]);
153 return $result;
154 }
155 public function toLessCode()
156 {
157 $result = '';
158 foreach (get_object_vars($this) as $name => $value) {
159 $varName = isset(self::$propertyNamesToLessVariableNames[$name]) ? self::$propertyNamesToLessVariableNames[$name] : $this->getGenericThemeVarName($name);
160 $result .= "@{$varName}: {$value};\n";
161 }
162 return $result;
163 }
164 private function getGenericThemeVarName($propertyName)
165 {
166 return 'theme-' . $propertyName;
167 }
168 }
169