Style menu hiện đại cho Flatsome
Code style
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | .header .sub-menu { display: flex; flex-direction: column; padding: 0; border-radius: var (--radius); } .header .nav-dropdown .menu-item:not(:last-child) { border-bottom: 1px solid #eee; } .header .nav-dropdown .menu-item a { border: none; } .header .nav-dropdown a { border: none; position: relative; overflow: hidden; } .header .nav-dropdown .menu-item a:before { content: "\f345" ; font-family: 'dashicons' ; position: absolute; top: 50%; left: -20px; transform: translateY(-50%); color: var (--primary-color); opacity: 0; transition: .3s; } .header .nav-dropdown .menu-item:hover>a:before { left: 0; opacity: 1; } .header .nav-dropdown .menu-item { transition: .3s; } .header .nav-dropdown .menu-item:hover>a { padding-left: 20px; color: var (--primary-color) !important; } .nav-dropdown-has-border .nav-dropdown { border-color: var (--primary-color); } .nav-dropdown-has-arrow.nav-dropdown-has-border li.has-dropdown:before { border-bottom-color: var (--primary-color); } .menu-item .nav-dropdown .menu-item-has-children { position: relative; width: 100%; } .menu-item .nav-dropdown .menu-item-has-children .sub-menu { position: absolute; top: 100%; left: 100%; min-width: 260px; background-color: #fff; box-shadow: 1px 1px 15px rgb(0 0 0 / 15%); transition: 0.3s; opacity: 0; } .menu-item-has-children .menu-item-has-children:hover .sub-menu { top: 0; opacity: 1; } .nav-dropdown-col > a { font-weight: 500 !important; text-transform: none !important; } .nav-dropdown>li.nav-dropdown-col { min-width: 260px; } .sub-menu a { color: var (--black-color) !important; font-size: 1rem !important; } .nav-dropdown-col::after { content: "\f345" ; font-family: 'dashicons' ; position: absolute; top: 50%; right: 0; transform: translateY(-50%); transition: .5s; } .nav-dropdown-col:hover:after { color: var (--primary-color); right: -10px; opacity: 0; } |
Code add to funtion
1 2 3 | add_action( 'wp_enqueue_scripts' , function () { wp_enqueue_style( 'dashicons' ); }); |