PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.8
Responsive Menu – Create Mobile-Friendly Menu v3.0.8
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / src / app / Mappers / ScssMenuMapper.php

ScssMenuMapper.php in Responsive Menu – Create Mobile-Friendly Menu 3.0.8, at src/app/Mappers/ScssMenuMapper.php

170 lines 6.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ResponsiveMenu\Mappers;
4
5 class ScssMenuMapper extends ScssMapper
6 {
7
8 public function map()
9 {
10
11 $css = <<<CSS
12
13 @media screen and ( max-width: {$this->options['breakpoint']}px ) {
14
15 @if '{$this->options['menu_close_on_body_click']}' == 'on' {
16 html.responsive-menu-open {
17 cursor: pointer;
18 #responsive-menu-container {
19 cursor: initial;
20 }
21 }
22 }
23
24 @if '{$this->options['page_wrapper']}' != '' {
25 & {$this->options['page_wrapper']} {
26 transition: transform {$this->options['animation_speed']}s;
27 }
28 html.responsive-menu-open,
29 .responsive-menu-open body {
30 width: 100%;
31 }
32 }
33
34 #responsive-menu-container {
35 width: {$this->options['menu_width']}%;
36 {$this->options['menu_appear_from']}: 0;
37 background: {$this->options['menu_background_colour']};
38 transition: transform {$this->options['animation_speed']}s;
39 text-align: {$this->options['menu_text_alignment']};
40
41 & #responsive-menu-wrapper {
42 background: {$this->options['menu_background_colour']};
43 }
44
45 #responsive-menu-additional-content {
46 color: {$this->options['menu_additional_content_colour']};
47 }
48
49 .responsive-menu-search-box {
50 background: {$this->options['menu_search_box_background_colour']};
51 border: 2px solid {$this->options['menu_search_box_border_colour']};
52 color: {$this->options['menu_search_box_text_colour']};
53 &:-ms-input-placeholder {
54 color: {$this->options['menu_search_box_placholder_colour']};
55 }
56 &:-webkit-input-placeholder {
57 color: {$this->options['menu_search_box_placholder_colour']};
58 }
59 &:-moz-placeholder {
60 color: {$this->options['menu_search_box_placholder_colour']};
61 opacity: 1;
62 }
63 &::-moz-placeholder {
64 color: {$this->options['menu_search_box_placholder_colour']};
65 opacity: 1;
66 }
67 }
68
69 @if '{$this->options['menu_maximum_width']}' != '' {
70 max-width: {$this->options['menu_maximum_width']}px;
71 }
72 @if '{$this->options['menu_minimum_width']}' != '' {
73 min-width: {$this->options['menu_minimum_width']}px;
74 }
75
76 @if '{$this->options['menu_font']}' != '' {
77 font-family: '{$this->options['menu_font']}';
78 }
79
80 & a, & #responsive-menu-title, & .responsive-menu-subarrow {
81 transition: all {$this->options['transition_speed']}s;
82 }
83
84 #responsive-menu-title {
85 background-color: {$this->options['menu_title_background_colour']};
86 color: {$this->options['menu_title_colour']};
87 font-size: {$this->options['menu_title_font_size']}px;
88 a {
89 color: {$this->options['menu_title_colour']};
90 text-decoration: none;
91 &:hover {
92 color: {$this->options['menu_title_hover_colour']};
93 }
94 }
95 &:hover {
96 background-color: {$this->options['menu_title_background_hover_colour']};
97 color: {$this->options['menu_title_hover_colour']};
98 a {
99 color: {$this->options['menu_title_hover_colour']};
100 }
101 }
102 #responsive-menu-title-image {
103 display: inline-block;
104 vertical-align: middle;
105 margin-right: 15px;
106 }
107 }
108
109 #responsive-menu {
110
111 li.responsive-menu-item {
112 .responsive-menu-item-link {
113 font-size: {$this->options['menu_font_size']}px;
114 }
115 a {
116 line-height: {$this->options['menu_links_height']}px;
117 border: 1px solid {$this->options['menu_item_border_colour']};
118 color: {$this->options['menu_link_colour']};
119 background-color: {$this->options['menu_item_background_colour']};
120 &:hover {
121 color: {$this->options['menu_link_hover_colour']};
122 background-color: {$this->options['menu_item_background_hover_colour']};
123 border-color: {$this->options['menu_item_border_colour_hover']};
124 .responsive-menu-subarrow {
125 color: {$this->options['menu_sub_arrow_shape_hover_colour']};
126 border-color: {$this->options['menu_sub_arrow_border_hover_colour']};
127 background-color: {$this->options['menu_sub_arrow_background_hover_colour']};
128 }
129 }
130
131 .responsive-menu-subarrow {
132 height: {$this->options['submenu_arrow_height']}px;
133 line-height: {$this->options['submenu_arrow_height']}px;
134 width: {$this->options['submenu_arrow_width']}px;
135 color: {$this->options['menu_sub_arrow_shape_colour']};
136 border-left: 1px solid {$this->options['menu_sub_arrow_border_colour']};
137 background-color: {$this->options['menu_sub_arrow_background_colour']};
138
139 &:hover {
140 color: {$this->options['menu_sub_arrow_shape_hover_colour']};
141 border-color: {$this->options['menu_sub_arrow_border_hover_colour']};
142 background-color: {$this->options['menu_sub_arrow_background_hover_colour']};
143 }
144 }
145 }
146 &.responsive-menu-current-item > .responsive-menu-item-link {
147 background-color: {$this->options['menu_current_item_background_colour']};
148 color: {$this->options['menu_current_link_colour']};
149 &:hover {
150 background-color: {$this->options['menu_current_item_background_hover_colour']};
151 color: {$this->options['menu_current_link_hover_colour']};
152 }
153 }
154 }
155 }
156 }
157 @if '{$this->options['menu_to_hide']}' != '' {
158 & {$this->options['menu_to_hide']} {
159 display: none;
160 }
161 }
162 }
163
164 CSS;
165
166 return $this->compiler->compile($css);
167 }
168
169 }
170