-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat(navigation): permet l'ajout d'icone sur les liens de navigation #913
base: main
Are you sure you want to change the base?
Changes from 3 commits
5bcbc5e
6e32710
2d4c4b9
137774b
b62a556
8bb0217
fd53053
0ab4bbf
94eb0de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,35 +2,38 @@ | |||||
let navigation = locals.navigation || {}; | ||||||
const href = navigation.href || '#' | ||||||
|
||||||
const getLink = () => { | ||||||
const getLink = (icon, iconPlace) => { | ||||||
const id = uniqueId('nav'); | ||||||
return { | ||||||
type: 'link', | ||||||
label: `accès direct ${id}`, | ||||||
id: id, | ||||||
href: href | ||||||
href: href, | ||||||
icon: icon, | ||||||
iconPlace: iconPlace | ||||||
}; | ||||||
|
||||||
} | ||||||
|
||||||
const getSubLink = (active = false) => { | ||||||
const getSubLink = (active = false, icon, iconPlace) => { | ||||||
const id = uniqueId('nav'); | ||||||
return { | ||||||
label: `Lien de navigation ${id}`, | ||||||
id: id, | ||||||
href: href, | ||||||
active: active | ||||||
active: active, | ||||||
icon: icon, | ||||||
iconPlace: iconPlace | ||||||
} | ||||||
} | ||||||
|
||||||
const getItems = (active = false) => { | ||||||
return [ | ||||||
getSubLink(), | ||||||
getSubLink(), | ||||||
getSubLink(false, 'arrow-right-line', 'right'), | ||||||
getSubLink(active), | ||||||
getSubLink(), | ||||||
getSubLink(), | ||||||
getSubLink(), | ||||||
getSubLink(false, 'arrow-left-line'), | ||||||
getSubLink(), | ||||||
getSubLink() | ||||||
]; | ||||||
|
@@ -47,12 +50,14 @@ const getMenu = (active = false) => { | |||||
} | ||||||
} | ||||||
|
||||||
const getCategory = (active = false) => { | ||||||
const getCategory = (active = false, icon, iconPlace) => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return { | ||||||
id: uniqueId('category'), | ||||||
label: 'Nom de catégorie', | ||||||
href: href, | ||||||
items: getItems(active) | ||||||
items: getItems(active), | ||||||
icon: icon, | ||||||
iconPlace: iconPlace | ||||||
}; | ||||||
} | ||||||
|
||||||
|
@@ -76,9 +81,9 @@ const getMega = (active = false, leader = false) => { | |||||
}}), | ||||||
categories: [ | ||||||
getCategory(), | ||||||
getCategory(), | ||||||
getCategory(false, 'arrow-left-line'), | ||||||
getCategory(true), | ||||||
getCategory() | ||||||
getCategory(false,'arrow-right-line', 'right') | ||||||
] | ||||||
} | ||||||
} | ||||||
|
@@ -90,10 +95,10 @@ let data = { | |||||
[ | ||||||
getMenu(), | ||||||
getMega(), | ||||||
getLink(), | ||||||
getLink('arrow-left-line'), | ||||||
getMenu(true), | ||||||
getMega(false, true), | ||||||
getLink(), | ||||||
getLink('arrow-right-line', 'right'), | ||||||
getMega(true, false), | ||||||
getMenu() | ||||||
] | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
//// | ||
|
||
@import '../link/index'; | ||
@import '../button/index'; | ||
|
||
@import '../../core/index'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,15 +50,9 @@ | |
// @include z-index(auto); | ||
|
||
@include selector.current { | ||
@include before { | ||
@include absolute(auto, null, 0, 0, 100%, 2px); | ||
@include margin-top(0); | ||
|
||
@include preference.forced-colors { | ||
background-color: highlight; | ||
@include height(1v); | ||
} | ||
} | ||
background-repeat: no-repeat; | ||
background-position: 0 100%; | ||
background-size: #{spacing.space(100% 0.5v)}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. j'ai l'impression que la version high contrast a été retirée sans être remise ailleurs. |
||
} | ||
} | ||
} | ||
|
@@ -82,6 +76,14 @@ | |
@include min-height(auto, lg); | ||
} | ||
|
||
#{ns(nav__btn)} { | ||
lab9fr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@include icon(arrow-down-s-line, sm, after) { | ||
@include margin-left(2v); | ||
@include margin-right(0); | ||
transition: transform 0.3s; | ||
} | ||
} | ||
|
||
@include respond-from(lg) { | ||
position: initial; | ||
@include before(none); | ||
|
@@ -95,6 +97,7 @@ | |
|
||
&__link, | ||
&__btn { | ||
@include nest-btn(sm, left, null, null, false); | ||
@include size(100%); | ||
@include padding(3v 4v); | ||
@include text-style(md); | ||
|
@@ -108,15 +111,9 @@ | |
|
||
@include selector.current { | ||
position: relative; | ||
@include before('', block) { | ||
@include absolute(50%, null, null, 0, 2px, 6v); | ||
@include margin-top(-3v); | ||
|
||
@include preference.forced-colors { | ||
background-color: highlight; | ||
@include width(1v); | ||
} | ||
} | ||
background-repeat: no-repeat; | ||
background-position: #{spacing.space(0 3v)}; | ||
background-size: #{spacing.space(2px calc(100% - 6v))}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idem ici pour le high contrast |
||
} | ||
} | ||
|
||
|
@@ -136,17 +133,6 @@ | |
flex-direction: row; | ||
@include padding(4v 3v 4v 4v, lg); | ||
|
||
@include icon(arrow-down-s-line, sm, after) { | ||
@include margin-left(2v); | ||
@include margin-right(0); | ||
transition: transform 0.3s; | ||
|
||
@include preference.reduce-motion { | ||
transition: none; | ||
} | ||
} | ||
@include icon-forced-color(buttontext, true, after); | ||
|
||
@include respond-from(lg) { | ||
justify-content: flex-start; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça me fait ticker de voir un argument par défaut en premier