Skip to content

Commit

Permalink
adjust the list styles to accomodate MWS
Browse files Browse the repository at this point in the history
  • Loading branch information
polmih committed May 14, 2024
1 parent 320ac3d commit 57be865
Show file tree
Hide file tree
Showing 8 changed files with 1,415 additions and 83 deletions.
10 changes: 10 additions & 0 deletions _data/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@
"title": "Liste groupé",
"language": "fr",
"path": "list-group-fr.html"
},
{
"title": "Custom list styling using parent div element",
"language": "en",
"path": "lists-mws-en.html"
},
{
"title": "Style de liste personnalisé à l'aide de l'élément div parent",
"language": "fr",
"path": "lists-mws-fr.html"
}
]
}
Expand Down
39 changes: 37 additions & 2 deletions _data/sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,28 @@
"language": "fr",
"path": "page-details-pft-share-fr.html"
}
],
"reports": [
{
"title": "Accessibility (Only new SC WCAG 2.1/2.2 Level AA)- Page Details - English report",
"language": "en",
"path": "reports/pre-a11y-1-en.html"
},
{
"title": "Accessibility (Only new SC WCAG 2.1/2.2 Level AA)- Page Details - French report",
"language": "fr",
"path": "reports/pre-a11y-1-fr.html"
},
{
"title": "Accessibility (Only new SC WCAG 2.1/2.2 Level AA)- Page Details (Basic Html version)- English report",
"language": "en",
"path": "reports/pre-a11y-basic-html-1-en.html"
},
{
"title": "Accessibility (Only new SC WCAG 2.1/2.2 Level AA)- Page Details (Basic Html version)- French report",
"language": "fr",
"path": "reports/pre-a11y-basic-html-1-fr.html"
}
]
},
"dependencies": [
Expand Down Expand Up @@ -3100,11 +3122,12 @@
"en": "Documentation and working example on how to use the skiplinks.",
"fr": "Documentation et example pratique sur l'utilisation des liens de saut de page."
},
"modified": "2022-01-12",
"modified": "2024-02-27",
"componentName": "skiplinks",
"processing": "baseline",
"status": "stable",
"pages": {
"docs": [
"examples": [
{
"title": "Skip links",
"language": "en",
Expand All @@ -3115,6 +3138,18 @@
"language": "fr",
"path": "skiplinks-fr.html"
}
],
"reports": [
{
"title": "Accessibility assessment #1 - Skip links",
"language": "en",
"path": "reports/a11y-1-en.html"
},
{
"title": "Évaluation d'accessibilité #1 - Liens de saut de page",
"language": "fr",
"path": "reports/a11y-1-fr.html"
}
]
}
}
Expand Down
177 changes: 177 additions & 0 deletions common/list/_lists.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
/*
*
* Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)
* wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
*
* @title: Lists
*
*/

/*
* List responsive style
*
* It has variant defined for some specific views
* - views/_screen-lg-min
* - views/_screen-xs-max
*/
.list-responsive {

> li {
float: left;
padding-right: 5px;
width: 50%;

&:nth-child(2n+2) {
clear:right;
}
}

&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}

/* Display lists in columns using Flexbox
* Add this class to a ul or ol to distribute its items in columns horizontally. Handles up to 4 columns.
* It has variants defined for some specific views:
* - _screen-sm-min
* - _screen-md-min
* - _screen-lg-min
*/
ul[class*=list-col] {
display: flex;
flex-wrap: wrap;
list-style: none;
padding-left: 0;
padding-right: 0;

> li {
flex-basis: 100%;
flex-grow: 0;
flex-shrink: 0;
}
}

/*
* this code is fully compatible with the equivalent CSS
* in the wet-boew code here: https://github.com/wet-boew/wet-boew/blob/master/src/base/lists/_base.scss
*/
ul.list-col-xs-1 > li { flex-basis: 100% }
ul.list-col-xs-2 > li { flex-basis: 50% }
ul.list-col-xs-3 > li { flex-basis: 33.33% }
ul.list-col-xs-4 > li { flex-basis: 25% }


div.lst-lwr-alph>ol,
.lst-lwr-alph {
list-style-type: lower-alpha;
}

div.lst-upr-alph>ol,
.lst-upr-alph {
list-style-type: upper-alpha;
}

div.lst-lwr-rmn>ol,
.lst-lwr-rmn {
list-style-type: lower-roman;
}

div.lst-upr-rmn>ol,
.lst-upr-rmn {
list-style-type: upper-roman;
}

.lst-num {
list-style-type: decimal;
}

div.lst-none>ul,
.lst-none {
list-style-type: none;
}


div.lst-spcd>ul,
div.lst-spcd>ol,
ol.lst-spcd,
ul.lst-spcd {
> {
li {
margin-bottom: 10px;
}
}

ul,
ol {
margin-top: 10px;
}
}

/* Double space list items
* Might worth to publish it upstream here instead: https://github.com/wet-boew/wet-boew/blob/master/src/base/lists/_base.scss#L30
*/
div.lst-spcd-2>ul,
div.lst-spcd-2>ol,
ul.lst-spcd-2,
ol.lst-spcd-2
{
> {
li {
margin-bottom: 20px;
}
}

ul,
ol {
margin-top: 20px;
}
}


/*
* The CSS for list-unstyled and list-inline classes is adapted from
* https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/css/theme.min.css
* to address the specific scenario where these styles are applied to a parent div.
* This adaptation accommodates edge cases where the styles need to be inherited by the parent element.
*
* Additional style for list also defined here: https://github.com/twbs/bootstrap-sass/blob/v3.4.3/assets/stylesheets/bootstrap/_type.scss#L146
*/

div.list-unstyled > ul {
list-style: none;
padding-left: 0;
}

div.list-inline > ul {
list-style: none;
margin-left: -5px;
padding-left: 0;

> li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
}

/*
* GCWeb/AEM: Custom CSS for list styling via parent <div>.
* Accommodates unique AEM scenario for consistent styling.
*/

div.list-advanced.disc>ul:first-child, ul.disc {
list-style-type:disc;
}

div.list-advanced.circle>ul:first-child, ul.circle {
list-style-type:circle;
}

div.list-advanced.square>ul:first-child, ul.square {
list-style-type:square;
}
10 changes: 10 additions & 0 deletions common/list/index.json-ld
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
"title": "Liste groupé",
"language": "fr",
"path": "list-group-fr.html"
},
{
"title": "Custom list styling using parent div element",
"language": "en",
"path": "lists-mws-en.html"
},
{
"title": "Style de liste personnalisé à l'aide de l'élément div parent",
"language": "fr",
"path": "lists-mws-fr.html"
}
]
}
Expand Down

0 comments on commit 57be865

Please sign in to comment.