Skip to content

Commit

Permalink
Merge branch 'main' into 2835/bug/ons-grid__col-sticky-css-functional…
Browse files Browse the repository at this point in the history
…ity-is-broken
  • Loading branch information
alessioventuriniAND authored Dec 7, 2023
2 parents 51e6edb + a96779c commit c996a86
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 20 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ Checkout the branch locally and run:

`yarn test-visual:approve` - This will approve the failures/diff caught by the tests.

`yarn test-visual:reference` - This will update the reference images locally on your machine.

`git lfs push --all origin` - First commit the files in the normal way then run the command. This will push the new reference images to Git LFS.

You can then commit and push your changes. The test images that would have been created when you ran `yest test-visual` are gitignored and the new references images will be pushed to Git LFS.
You can then commit and push the updated references and your changes to your branch. The test images that would have been created when you ran `yarn test-visual` are gitignored and the new references images will be pushed to Git LFS.

If your local tests are failing but you have approved them, run `yarn test-visual:reference`. This will update the reference images locally on your machine.

## Build

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions src/components/pagination/_macro-options.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
| Name | Type | Required | Description |
| ------------------ | ------------- | -------- | ------------------------------------------------------------------ |
| pages | `Array<Page>` | true | Settings for each [page](#page) |
| currentPageNumber | integer | true | Sets the current page number |
| previous | string | false | Text label for the “Previous” link. Default is "Previous". |
| next | string | false | Text label for the “Next” link. Default is "Next". |
| classes | string | false | Classes to add to the pagination HTML `nav` element |
| hideRangeIndicator | boolean | false | Set to “true” to hide the range indicator on viewports &geq; 740px |
| Name | Type | Required | Description |
| ------------------ | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| pages | `Array<Page>` | true | Settings for each [page](#page) |
| currentPageNumber | integer | true | Sets the current page number |
| previous | string | false | Text label for the “Previous” link. Default is "Previous". |
| next | string | false | Text label for the “Next” link. Default is "Next". |
| classes | string | false | Classes to add to the pagination HTML `nav` element |
| hideRangeIndicator | boolean | false | Set to “true” to hide the range indicator on viewports &geq; 740px |
| headingLevel | string | false | Number used to determine the heading level to ensure it has the correct semantic order on the page. Defaults to `2` |

## Page

Expand Down
24 changes: 18 additions & 6 deletions src/components/section-navigation/_macro.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% macro onsSectionNavigation(params) %}
{% set headingLevel = params.headingLevel | int | default(2) %}
{% set sectionTitleHeadingLevel = headingLevel + 1 %}
<nav class="ons-section-nav{% if params.variants == 'vertical' %} ons-section-nav--vertical{% endif %} {% if params.classes %} {{ params.classes }} {% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %} aria-labelledby="{{ params.hiddenTitleId | default("section-menu-nav-title")}}">
<h2 class="ons-u-vh" id="{{ params.hiddenTitleId | default("section-menu-nav-title") }}">{{ params.hiddenTitle | default("Pages in this section") }}</h2>
<h{{ headingLevel }} class="ons-u-vh" id="{{ params.hiddenTitleId | default("section-menu-nav-title") }}">{{ params.hiddenTitle | default("Pages in this section") }}</h{{ headingLevel }}>
{% if params.sections %}
{% for section in params.sections %}
{% set sectionItemHeadingLevel = headingLevel + 2 if section.title else headingLevel + 1 %}
<div class="ons-section-nav__sub">
{% if section.title %}
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h3>
<h{{ sectionTitleHeadingLevel }} class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h{{ sectionTitleHeadingLevel }}>
{% endif %}
<ul class="ons-section-nav__list">
{% for item in section.itemsList %}
Expand All @@ -15,8 +18,12 @@
{% set isCurrent = false %}
{% endif %}
<li class="ons-section-nav__item{% if item.classes %}{{ ' ' + item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
{% if item.anchors and isCurrent == true %}
{% if isCurrent == true %}
<h{{ sectionItemHeadingLevel }} class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}" aria-current="location">{{ item.title }}</h{{ sectionItemHeadingLevel }}>
{% else %}
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.title }}</a>
{% endif %}
{% if item.anchors and isCurrent == true %}
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
{% for anchor in item.anchors %}
<li class="ons-section-nav__item ons-list__item">
Expand All @@ -32,17 +39,22 @@
{% endfor %}
{% else %}
{% if params.title %}
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h3>
<h{{ sectionTitleHeadingLevel }} class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h{{ sectionTitleHeadingLevel }}>
{% endif %}
<ul class="ons-section-nav__list">
{% for item in params.itemsList %}
{% set sectionItemHeadingLevel = headingLevel + 2 if params.title else headingLevel + 1 %}
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
{% set isCurrent = true %}
{% else %}
{% set isCurrent = false %}
{% endif %}
<li class="ons-section-nav__item{% if item.classes %}{{ ' ' + item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
{% if isCurrent == true %}
<h{{ sectionItemHeadingLevel}} class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}" aria-current="location">{{ item.title }}</h{{ headingLevel + 2 if section.title else headingLevel + 1 }}>
{% else %}
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.title }}</a>
{% endif %}
{% if item.anchors %}
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
{% for anchor in item.anchors %}
Expand Down
22 changes: 20 additions & 2 deletions src/components/section-navigation/_section-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
font-weight: $font-weight-bold;
margin-left: -18px;
padding-left: 14px;
a {
a,
h2,
h3,
h4,
h5,
h6 {
color: var(--ons-color-text-link-active);
}
}
Expand All @@ -39,6 +44,14 @@
}
}

&__item-header {
@extend .ons-u-mb-no;

font-size: 1rem;
font-weight: 700;
line-height: 1.6;
}

&__sub-items {
a {
color: var(--ons-color-text-link);
Expand All @@ -58,7 +71,12 @@
border-color: var(--ons-color-text-link-active);
margin: 0 1rem 0 0;
padding: 0;
a {
a,
h2,
h3,
h4,
h5,
h6 {
color: var(--ons-color-text-link-active);
}
}
Expand Down

0 comments on commit c996a86

Please sign in to comment.