| 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 |
@if '{$this->options['menu_maximum_width']}' != '' { |
| 50 |
max-width: {$this->options['menu_maximum_width']}px; |
| 51 |
} |
| 52 |
@if '{$this->options['menu_minimum_width']}' != '' { |
| 53 |
min-width: {$this->options['menu_minimum_width']}px; |
| 54 |
} |
| 55 |
|
| 56 |
@if '{$this->options['menu_font']}' != '' { |
| 57 |
font-family: '{$this->options['menu_font']}'; |
| 58 |
} |
| 59 |
|
| 60 |
& a, & #responsive-menu-title, & .responsive-menu-subarrow { |
| 61 |
transition: all {$this->options['transition_speed']}s; |
| 62 |
} |
| 63 |
|
| 64 |
#responsive-menu-title { |
| 65 |
background-color: {$this->options['menu_title_background_colour']}; |
| 66 |
color: {$this->options['menu_title_colour']}; |
| 67 |
font-size: {$this->options['menu_title_font_size']}px; |
| 68 |
a { |
| 69 |
color: {$this->options['menu_title_colour']}; |
| 70 |
text-decoration: none; |
| 71 |
&:hover { |
| 72 |
color: {$this->options['menu_title_hover_colour']}; |
| 73 |
} |
| 74 |
} |
| 75 |
&:hover { |
| 76 |
background-color: {$this->options['menu_title_background_hover_colour']}; |
| 77 |
color: {$this->options['menu_title_hover_colour']}; |
| 78 |
a { |
| 79 |
color: {$this->options['menu_title_hover_colour']}; |
| 80 |
} |
| 81 |
} |
| 82 |
#responsive-menu-title-image { |
| 83 |
display: inline-block; |
| 84 |
vertical-align: middle; |
| 85 |
margin-right: 15px; |
| 86 |
} |
| 87 |
} |
| 88 |
|
| 89 |
#responsive-menu { |
| 90 |
|
| 91 |
li.responsive-menu-item { |
| 92 |
.responsive-menu-item-link { |
| 93 |
font-size: {$this->options['menu_font_size']}px; |
| 94 |
} |
| 95 |
a { |
| 96 |
line-height: {$this->options['menu_links_height']}px; |
| 97 |
border: 1px solid {$this->options['menu_item_border_colour']}; |
| 98 |
color: {$this->options['menu_link_colour']}; |
| 99 |
background-color: {$this->options['menu_item_background_colour']}; |
| 100 |
&:hover { |
| 101 |
color: {$this->options['menu_link_hover_colour']}; |
| 102 |
background-color: {$this->options['menu_item_background_hover_colour']}; |
| 103 |
border-color: {$this->options['menu_item_border_colour_hover']}; |
| 104 |
.responsive-menu-subarrow { |
| 105 |
color: {$this->options['menu_sub_arrow_shape_hover_colour']}; |
| 106 |
border-color: {$this->options['menu_sub_arrow_border_hover_colour']}; |
| 107 |
background-color: {$this->options['menu_sub_arrow_background_hover_colour']}; |
| 108 |
} |
| 109 |
} |
| 110 |
|
| 111 |
.responsive-menu-subarrow { |
| 112 |
height: {$this->options['submenu_arrow_height']}px; |
| 113 |
line-height: {$this->options['submenu_arrow_height']}px; |
| 114 |
width: {$this->options['submenu_arrow_width']}px; |
| 115 |
color: {$this->options['menu_sub_arrow_shape_colour']}; |
| 116 |
border-left: 1px solid {$this->options['menu_sub_arrow_border_colour']}; |
| 117 |
background-color: {$this->options['menu_sub_arrow_background_colour']}; |
| 118 |
|
| 119 |
&:hover { |
| 120 |
color: {$this->options['menu_sub_arrow_shape_hover_colour']}; |
| 121 |
border-color: {$this->options['menu_sub_arrow_border_hover_colour']}; |
| 122 |
background-color: {$this->options['menu_sub_arrow_background_hover_colour']}; |
| 123 |
} |
| 124 |
} |
| 125 |
} |
| 126 |
&.responsive-menu-current-item > .responsive-menu-item-link { |
| 127 |
background-color: {$this->options['menu_current_item_background_colour']}; |
| 128 |
color: {$this->options['menu_current_link_colour']}; |
| 129 |
&:hover { |
| 130 |
background-color: {$this->options['menu_current_item_background_hover_colour']}; |
| 131 |
color: {$this->options['menu_current_link_hover_colour']}; |
| 132 |
} |
| 133 |
} |
| 134 |
} |
| 135 |
} |
| 136 |
} |
| 137 |
@if '{$this->options['menu_to_hide']}' != '' { |
| 138 |
& {$this->options['menu_to_hide']} { |
| 139 |
display: none; |
| 140 |
} |
| 141 |
} |
| 142 |
} |
| 143 |
|
| 144 |
CSS; |
| 145 |
|
| 146 |
return $this->compiler->compile($css); |
| 147 |
} |
| 148 |
|
| 149 |
} |
| 150 |
|