🚧 Depura la estructura y estilos del menú e intro
This commit is contained in:
		
							parent
							
								
									4c8610af07
								
							
						
					
					
						commit
						fef927906c
					
				
					 8 changed files with 302 additions and 163 deletions
				
			
		| 
						 | 
				
			
			@ -1,54 +1,92 @@
 | 
			
		|||
/* Aislamiento & normalización */
 | 
			
		||||
 | 
			
		||||
.menu {
 | 
			
		||||
	isolation: isolate;
 | 
			
		||||
}
 | 
			
		||||
@supports (all: revert) {
 | 
			
		||||
	.menu {
 | 
			
		||||
		all: revert;
 | 
			
		||||
		display: block; }
 | 
			
		||||
}
 | 
			
		||||
.menu {
 | 
			
		||||
	box-sizing: border-box;
 | 
			
		||||
	line-height: var(--val-menu--line-height, 1.5);
 | 
			
		||||
	color: var(--val-color--text);
 | 
			
		||||
	text-align: left;
 | 
			
		||||
	text-transform: none;
 | 
			
		||||
	letter-spacing: normal;
 | 
			
		||||
	word-spacing: normal;
 | 
			
		||||
	white-space: normal;
 | 
			
		||||
	cursor: default;
 | 
			
		||||
	-webkit-font-smoothing: antialiased;
 | 
			
		||||
	-moz-osx-font-smoothing: grayscale;
 | 
			
		||||
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: auto;
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	z-index: 9999;
 | 
			
		||||
	border: none;
 | 
			
		||||
	outline: none;
 | 
			
		||||
	border: 0;
 | 
			
		||||
	background: var(--val-menu--color-bg);
 | 
			
		||||
}
 | 
			
		||||
.menu *,
 | 
			
		||||
.menu *::before,
 | 
			
		||||
.menu *::after {
 | 
			
		||||
	box-sizing: inherit;
 | 
			
		||||
}
 | 
			
		||||
.menu :where(a, button) {
 | 
			
		||||
	appearance: none;
 | 
			
		||||
	background: none;
 | 
			
		||||
	border: 0;
 | 
			
		||||
	font: inherit;
 | 
			
		||||
	color: inherit;
 | 
			
		||||
	text-decoration: none;
 | 
			
		||||
	cursor: pointer;
 | 
			
		||||
	-webkit-tap-highlight-color: transparent;
 | 
			
		||||
}
 | 
			
		||||
.menu :where(a, button):focus-visible {
 | 
			
		||||
	outline: 2px solid var(--val-menu--color-highlight);
 | 
			
		||||
	outline-offset: 2px;
 | 
			
		||||
}
 | 
			
		||||
.menu :where(ul, ol) {
 | 
			
		||||
	list-style: none;
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
.menu svg {
 | 
			
		||||
	fill: currentColor;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Estructura */
 | 
			
		||||
 | 
			
		||||
.menu__wrapper {
 | 
			
		||||
	padding-right: var(--val-gap);
 | 
			
		||||
}
 | 
			
		||||
.menu__wrapper a,
 | 
			
		||||
.menu__wrapper button {
 | 
			
		||||
	cursor: pointer;
 | 
			
		||||
	border: none;
 | 
			
		||||
	background: none;
 | 
			
		||||
	text-decoration: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.menu__nav ul {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
.menu__nav li {
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	margin: 0 0 0 1.5rem;
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	margin-inline-start: 1.5rem;
 | 
			
		||||
	padding: 0;
 | 
			
		||||
	line-height: var(--val-menu--item-height);
 | 
			
		||||
	list-style: none;
 | 
			
		||||
	list-style-type: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.menu__item--label,
 | 
			
		||||
.menu__nav li > a {
 | 
			
		||||
.menu__nav li > .menu__link {
 | 
			
		||||
	position: relative;
 | 
			
		||||
	font-weight: 500;
 | 
			
		||||
	color: var(--val-color--text);
 | 
			
		||||
	font-weight: normal;
 | 
			
		||||
	text-rendering: optimizeLegibility;
 | 
			
		||||
	font-size: 1.45rem;
 | 
			
		||||
}
 | 
			
		||||
.menu__nav li > a {
 | 
			
		||||
	border: none;
 | 
			
		||||
.menu__nav li > .menu__link {
 | 
			
		||||
	transition: color 0.3s ease-in-out;
 | 
			
		||||
}
 | 
			
		||||
.menu__nav li:hover > a,
 | 
			
		||||
.menu__nav li > a:focus {
 | 
			
		||||
.menu__nav li:hover > .menu__link,
 | 
			
		||||
.menu__nav li > .menu__link:focus {
 | 
			
		||||
	color: var(--val-menu--color-highlight);
 | 
			
		||||
}
 | 
			
		||||
.menu__nav li > a > svg.icon {
 | 
			
		||||
.menu__nav li > .menu__link > svg.icon {
 | 
			
		||||
	margin-left: 0.25rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -57,19 +95,18 @@
 | 
			
		|||
	max-width: 100%;
 | 
			
		||||
	height: auto;
 | 
			
		||||
	padding: var(--val-gap-0-5) var(--val-gap-1-5);
 | 
			
		||||
	border: none;
 | 
			
		||||
	outline: none;
 | 
			
		||||
	border: 0;
 | 
			
		||||
	background: var(--val-menu--color-bg);
 | 
			
		||||
	border-top: 3px solid var(--val-menu--color-highlight);
 | 
			
		||||
	z-index: 500;
 | 
			
		||||
	opacity: 0;
 | 
			
		||||
	visibility: hidden;
 | 
			
		||||
	box-shadow: 0 4px 6px -1px var(--val-menu--color-border), 0 2px 4px -1px var(--val-menu--color-shadow);
 | 
			
		||||
	transition: all 0.5s ease-in-out;
 | 
			
		||||
	transition: all 0.3s ease-in-out;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.menu__item--children:hover > .menu__children,
 | 
			
		||||
.menu__item--children > a:focus + .menu__children,
 | 
			
		||||
.menu__item--children > .menu__link:focus + .menu__children,
 | 
			
		||||
.menu__item--children .menu__children:focus-within {
 | 
			
		||||
	margin-top: 0.4rem;
 | 
			
		||||
	opacity: 1;
 | 
			
		||||
| 
						 | 
				
			
			@ -81,14 +118,12 @@
 | 
			
		|||
	max-width: var(--val-menu--item-width-max);
 | 
			
		||||
}
 | 
			
		||||
.menu__submenu-title {
 | 
			
		||||
	font-family: inherit;
 | 
			
		||||
	font-size: 1rem;
 | 
			
		||||
	font-weight: 500;
 | 
			
		||||
	font-weight: normal;
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: var(--val-menu--line-padding) 0;
 | 
			
		||||
	line-height: var(--val-menu--line-height);
 | 
			
		||||
	border: none;
 | 
			
		||||
	outline: none;
 | 
			
		||||
	border: 0;
 | 
			
		||||
	color: var(--val-menu--color-highlight);
 | 
			
		||||
	text-transform: uppercase;
 | 
			
		||||
	text-rendering: optimizeLegibility;
 | 
			
		||||
| 
						 | 
				
			
			@ -113,18 +148,15 @@
 | 
			
		|||
	display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Applies <= 992px */
 | 
			
		||||
@media only screen and (max-width: 62rem) {
 | 
			
		||||
/* Responsive <= 62rem (992px) */
 | 
			
		||||
 | 
			
		||||
@media (max-width: 62rem) {
 | 
			
		||||
	.menu__wrapper {
 | 
			
		||||
		padding-right: var(--val-gap-0-5);
 | 
			
		||||
	}
 | 
			
		||||
	.menu__trigger {
 | 
			
		||||
		cursor: pointer;
 | 
			
		||||
		width: var(--val-menu--trigger-width);
 | 
			
		||||
		height: var(--val-menu--item-height);
 | 
			
		||||
		border: none;
 | 
			
		||||
		outline: none;
 | 
			
		||||
		background: none;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		flex-direction: column;
 | 
			
		||||
		justify-content: center;
 | 
			
		||||
| 
						 | 
				
			
			@ -133,6 +165,13 @@
 | 
			
		|||
		width: 2rem;
 | 
			
		||||
		height: 2rem;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.menu__nav,
 | 
			
		||||
	.menu__children {
 | 
			
		||||
		overscroll-behavior: contain;
 | 
			
		||||
		-webkit-overflow-scrolling: touch;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.menu__nav {
 | 
			
		||||
		position: fixed;
 | 
			
		||||
		top: 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -143,10 +182,16 @@
 | 
			
		|||
		overflow: hidden;
 | 
			
		||||
		background: var(--val-menu--color-bg);
 | 
			
		||||
		transform: translate(-100%);
 | 
			
		||||
		transition: all 0.5s ease-in-out;
 | 
			
		||||
		transition: transform .5s ease-in-out, opacity .5s ease-in-out;
 | 
			
		||||
		will-change: transform;
 | 
			
		||||
		backface-visibility: hidden;
 | 
			
		||||
		visibility: hidden;
 | 
			
		||||
		pointer-events: none;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__nav.active {
 | 
			
		||||
		transform: translate(0%);
 | 
			
		||||
		visibility: visible;
 | 
			
		||||
		pointer-events: auto;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	.menu__nav li {
 | 
			
		||||
| 
						 | 
				
			
			@ -156,16 +201,18 @@
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	.menu__item--label,
 | 
			
		||||
	.menu__nav li > a {
 | 
			
		||||
	.menu__nav li > .menu__link {
 | 
			
		||||
		display: block;
 | 
			
		||||
		text-align: inherit;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		padding: var(--val-menu--line-padding) var(--val-menu--item-height) var(--val-menu--line-padding) var(--val-menu--item-gap);
 | 
			
		||||
		border-bottom: 1px solid var(--val-menu--color-border);
 | 
			
		||||
	}
 | 
			
		||||
	.menu__nav li ul li.menu__item--label,
 | 
			
		||||
	.menu__nav li ul li > a {
 | 
			
		||||
	.menu__nav li ul li > .menu__link {
 | 
			
		||||
		border-bottom: 0;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__nav li > a > svg.icon {
 | 
			
		||||
	.menu__nav li > .menu__link > svg.icon {
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		top: var(--val-menu--line-padding);
 | 
			
		||||
		right: var(--val-menu--line-padding);
 | 
			
		||||
| 
						 | 
				
			
			@ -191,6 +238,7 @@
 | 
			
		|||
		visibility: visible;
 | 
			
		||||
		transform: translateX(0%);
 | 
			
		||||
		box-shadow: none;
 | 
			
		||||
		transition: opacity .5s ease-in-out, transform .5s ease-in-out, margin-top .5s ease-in-out;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__children.active {
 | 
			
		||||
		display: block;
 | 
			
		||||
| 
						 | 
				
			
			@ -223,6 +271,16 @@
 | 
			
		|||
		white-space: nowrap;
 | 
			
		||||
        overflow: hidden;
 | 
			
		||||
        text-overflow: ellipsis;
 | 
			
		||||
		font-size: 1.45rem;
 | 
			
		||||
		font-weight: normal;
 | 
			
		||||
		opacity: 0;
 | 
			
		||||
		transform: translateY(.25rem);
 | 
			
		||||
		transition: opacity .5s ease-in-out, transform .5s ease-in-out;
 | 
			
		||||
		will-change: opacity, transform;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__header.active .menu__title {
 | 
			
		||||
		opacity: 1;
 | 
			
		||||
		transform: translateY(0);
 | 
			
		||||
	}
 | 
			
		||||
	.menu__close,
 | 
			
		||||
	.menu__back {
 | 
			
		||||
| 
						 | 
				
			
			@ -231,18 +289,20 @@
 | 
			
		|||
		height: var(--val-menu--item-height);
 | 
			
		||||
		line-height: var(--val-menu--item-height);
 | 
			
		||||
		color: var(--val-color--text);
 | 
			
		||||
		cursor: pointer;
 | 
			
		||||
		display: flex;
 | 
			
		||||
		align-items: center;
 | 
			
		||||
		justify-content: center;
 | 
			
		||||
		background: var(--val-menu--color-bg);
 | 
			
		||||
	}
 | 
			
		||||
	.menu__close {
 | 
			
		||||
		font-size: 2.25rem;
 | 
			
		||||
		border-left: 1px solid var(--val-menu--color-border) !important;
 | 
			
		||||
		border: 1px solid var(--val-menu--color-border) !important;
 | 
			
		||||
		border-width: 0 0 1px 1px !important;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__back {
 | 
			
		||||
		font-size: 1.25rem;
 | 
			
		||||
		border-right: 1px solid var(--val-menu--color-border) !important;
 | 
			
		||||
		border: 1px solid var(--val-menu--color-border) !important;
 | 
			
		||||
		border-width: 0 1px 1px 0 !important;
 | 
			
		||||
		display: none;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__header.active .menu__back {
 | 
			
		||||
| 
						 | 
				
			
			@ -267,15 +327,34 @@
 | 
			
		|||
		opacity: 0;
 | 
			
		||||
		visibility: hidden;
 | 
			
		||||
		background: rgba(0, 0, 0, 0.55);
 | 
			
		||||
		transition: all 0.5s ease-in-out;
 | 
			
		||||
		transition: opacity .5s ease-in-out, visibility 0s linear .5s;
 | 
			
		||||
	}
 | 
			
		||||
	.menu__overlay.active {
 | 
			
		||||
		opacity: 1;
 | 
			
		||||
		visibility: visible;
 | 
			
		||||
		transition-delay: 0s, 0s;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media (hover: hover) and (pointer: fine) {
 | 
			
		||||
	.menu__item--children:hover > .menu__children {
 | 
			
		||||
		margin-top: 0.4rem;
 | 
			
		||||
		opacity: 1;
 | 
			
		||||
		visibility: visible;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ANIMATIONS */
 | 
			
		||||
@media (prefers-reduced-motion: reduce) {
 | 
			
		||||
	.menu__nav,
 | 
			
		||||
	.menu__children,
 | 
			
		||||
	.menu__title,
 | 
			
		||||
	.menu__overlay {
 | 
			
		||||
		transition: none !important;
 | 
			
		||||
		animation: none !important;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Animaciones */
 | 
			
		||||
 | 
			
		||||
@keyframes slideLeft {
 | 
			
		||||
	0% {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue