| 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 |
& .responsive-menu-item-link, & #responsive-menu-title, & .responsive-menu-subarrow { |
| 81 |
transition: background-color {$this->options['transition_speed']}s, border-color {$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-top: 1px solid {$this->options['menu_item_border_colour']}; |
| 118 |
border-bottom: 1px solid {$this->options['menu_item_border_colour']}; |
| 119 |
color: {$this->options['menu_link_colour']}; |
| 120 |
background-color: {$this->options['menu_item_background_colour']}; |
| 121 |
&:hover { |
| 122 |
color: {$this->options['menu_link_hover_colour']}; |
| 123 |
background-color: {$this->options['menu_item_background_hover_colour']}; |
| 124 |
border-color: {$this->options['menu_item_border_colour_hover']}; |
| 125 |
.responsive-menu-subarrow { |
| 126 |
color: {$this->options['menu_sub_arrow_shape_hover_colour']}; |
| 127 |
border-color: {$this->options['menu_sub_arrow_border_hover_colour']}; |
| 128 |
background-color: {$this->options['menu_sub_arrow_background_hover_colour']}; |
| 129 |
} |
| 130 |
} |
| 131 |
|
| 132 |
.responsive-menu-subarrow { |
| 133 |
height: {$this->options['submenu_arrow_height']}px; |
| 134 |
line-height: {$this->options['submenu_arrow_height']}px; |
| 135 |
width: {$this->options['submenu_arrow_width']}px; |
| 136 |
color: {$this->options['menu_sub_arrow_shape_colour']}; |
| 137 |
border-left: 1px solid {$this->options['menu_sub_arrow_border_colour']}; |
| 138 |
background-color: {$this->options['menu_sub_arrow_background_colour']}; |
| 139 |
|
| 140 |
&:hover { |
| 141 |
color: {$this->options['menu_sub_arrow_shape_hover_colour']}; |
| 142 |
border-color: {$this->options['menu_sub_arrow_border_hover_colour']}; |
| 143 |
background-color: {$this->options['menu_sub_arrow_background_hover_colour']}; |
| 144 |
} |
| 145 |
} |
| 146 |
} |
| 147 |
&.responsive-menu-current-item > .responsive-menu-item-link { |
| 148 |
background-color: {$this->options['menu_current_item_background_colour']}; |
| 149 |
color: {$this->options['menu_current_link_colour']}; |
| 150 |
border-color: {$this->options['menu_current_item_border_colour']}; |
| 151 |
&:hover { |
| 152 |
background-color: {$this->options['menu_current_item_background_hover_colour']}; |
| 153 |
color: {$this->options['menu_current_link_hover_colour']}; |
| 154 |
border-color: {$this->options['menu_current_item_border_hover_colour']}; |
| 155 |
} |
| 156 |
} |
| 157 |
} |
| 158 |
} |
| 159 |
} |
| 160 |
@if '{$this->options['menu_to_hide']}' != '' { |
| 161 |
& {$this->options['menu_to_hide']} { |
| 162 |
display: none; |
| 163 |
} |
| 164 |
} |
| 165 |
} |
| 166 |
|
| 167 |
CSS; |
| 168 |
|
| 169 |
return $this->compiler->compile($css); |
| 170 |
} |
| 171 |
|
| 172 |
} |
| 173 |
|