Skip to content
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

Add formatting for Nunjucks files #3218

Merged
merged 112 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
21e9d72
add formatting for nunjucks files
rmccar May 24, 2024
b4337f5
add plugin
rmccar May 24, 2024
4005db1
Merge branch 'main' into add-formatting-for-nunjucks-files
rmccar May 28, 2024
5f11386
fix example
rmccar May 28, 2024
d822876
add njk and html files to lint staged
rmccar May 28, 2024
37678cc
test
rmccar May 28, 2024
ec6a374
test
rmccar May 28, 2024
40ba41e
update prettier to latest
rmccar May 28, 2024
7e0b41a
fix title tag var
rmccar May 28, 2024
c710175
formatting
rmccar May 30, 2024
405136e
fix list
rmccar May 30, 2024
9757bf2
fix button
rmccar May 30, 2024
f30f802
formatting
rmccar May 30, 2024
a9d59c4
formatting
rmccar May 30, 2024
e5fe86c
Merge branch 'main' into add-formatting-for-nunjucks-files
rmccar May 30, 2024
993da2a
fixes
rmccar May 31, 2024
2197964
Merge branch 'add-formatting-for-nunjucks-files' of github.com:ONSdig…
rmccar May 31, 2024
3e24cb6
fixes
rmccar May 31, 2024
d99c12c
fixes
rmccar May 31, 2024
79cae3c
merge main
rmccar Jun 5, 2024
17cd7fc
merge main
rmccar Jun 5, 2024
9f925ac
fixes
rmccar Jun 5, 2024
877fd16
fixes
rmccar Jun 5, 2024
40ab44d
fixes
rmccar Jun 5, 2024
58105ac
fixes
rmccar Jun 5, 2024
aef848d
fixes
rmccar Jun 5, 2024
26fd7ad
fixes
rmccar Jun 5, 2024
ee34d6a
panel
rmccar Jun 5, 2024
7dc8695
fixes
rmccar Jun 5, 2024
93f81e9
fixes
rmccar Jun 5, 2024
4f4252a
fixes
rmccar Jun 5, 2024
1f75842
document list
rmccar Jun 6, 2024
01a79c0
label
rmccar Jun 6, 2024
737d524
layout
rmccar Jun 6, 2024
d925b2b
update input
rmccar Jun 6, 2024
8f8335e
input
rmccar Jun 6, 2024
ee075ec
input
rmccar Jun 6, 2024
b397c14
test
rmccar Jun 6, 2024
301cfca
input classes
rmccar Jun 6, 2024
d6ff587
label classes
rmccar Jun 6, 2024
a9c054b
input classes
rmccar Jun 6, 2024
31902ef
details field and fieldset classes
rmccar Jun 6, 2024
82bdba5
address autosuggest classes
rmccar Jun 6, 2024
6ddadab
Merge branch 'main' into add-formatting-for-nunjucks-files
rmccar Jun 14, 2024
fe7dc2c
formatting
rmccar Jun 14, 2024
c0e638c
panel classes
rmccar Jun 14, 2024
abd0a07
remove label class
rmccar Jun 14, 2024
4acf9ae
fix input
rmccar Jun 14, 2024
7dc1024
pagination classes
rmccar Jun 14, 2024
f8505ff
remove unused imports
rmccar Jun 14, 2024
99873f3
address output classes
rmccar Jun 14, 2024
de4d1f0
fix address example
rmccar Jun 14, 2024
646641c
fix dowloadable resources and remove elses
rmccar Jun 14, 2024
a6337a3
fix guide
rmccar Jun 14, 2024
f539241
fix select and question
rmccar Jun 14, 2024
0e0401a
fix addresses
rmccar Jun 14, 2024
5bd47a6
fix autosuggest
rmccar Jun 14, 2024
b6cc0a8
fix checkboxes
rmccar Jun 14, 2024
b7f20eb
remove elses
rmccar Jun 14, 2024
a1ca7dd
remove spaces
rmccar Jun 14, 2024
1c136f3
fix welsh header example
rmccar Jun 14, 2024
c36ef25
fix header
rmccar Jun 14, 2024
465200d
fix hero
rmccar Jun 14, 2024
b0c0191
fix textarea
rmccar Jun 14, 2024
9cf8e72
fix textarea
rmccar Jun 14, 2024
e5b724c
fix textarea
rmccar Jun 14, 2024
34fef51
update class logic
rmccar Jun 14, 2024
61e56a1
reorganise classes
rmccar Jun 14, 2024
0e2b72a
fix document list
rmccar Jun 17, 2024
468117f
refactor dynamic tags and remove most prettier ignores
rmccar Jun 18, 2024
2316b04
fix heading
rmccar Jun 18, 2024
c40a9c0
add safe filter to tags
rmccar Jun 18, 2024
ee9b9af
various fixes
rmccar Jun 18, 2024
f1e44f2
fix list
rmccar Jun 18, 2024
5fc18cf
update class logic
rmccar Jun 18, 2024
59eead1
fix tab gaps
rmccar Jun 19, 2024
cb3aa86
update vr snapshots
rmccar Jun 19, 2024
3964e2b
fix tests
rmccar Jun 19, 2024
04bd67a
fix tests
rmccar Jun 19, 2024
086aa63
fix tests
rmccar Jun 19, 2024
79c2794
fix tests
rmccar Jun 19, 2024
da2e8dc
fix footer test
rmccar Jun 19, 2024
53d2482
fix input test
rmccar Jun 19, 2024
0681b46
update snapshots
rmccar Jun 19, 2024
66ada37
fix tests
rmccar Jun 19, 2024
f25f87e
fix test
rmccar Jun 19, 2024
defdce9
remove erroneous test
rmccar Jun 19, 2024
aa23d68
fix test
rmccar Jun 19, 2024
c4a68e6
fix test
rmccar Jun 19, 2024
2864809
some tidying up
rmccar Jun 20, 2024
6b93d20
setting social class when using social logos
rmccar Jun 20, 2024
8b7b032
update vr snapshots
rmccar Jun 20, 2024
fc2ba0e
revert example
rmccar Jun 20, 2024
9f989a5
Merge branch 'main' into add-formatting-for-nunjucks-files
rmccar Jun 20, 2024
5ebfabc
revert header example
rmccar Jun 27, 2024
19c036a
revert
rmccar Jun 27, 2024
5ec9307
revert social list changes
rmccar Jun 27, 2024
911d5fe
update snapshots
rmccar Jun 27, 2024
e81335a
add elses
rmccar Jun 28, 2024
88283cb
add elses
rmccar Jun 28, 2024
3b1c568
add elses
rmccar Jun 28, 2024
8df76a6
remove
rmccar Jun 28, 2024
b1e4795
fixes for jinja
rmccar Jun 28, 2024
ff0f5a7
fixes for jinja
rmccar Jun 28, 2024
016c354
fixes for jinja
rmccar Jun 28, 2024
7c70634
fixes for jinja
rmccar Jun 28, 2024
413619e
fixes for jinja
rmccar Jun 28, 2024
9ae8879
fixes for jinja
rmccar Jun 28, 2024
e3ccac1
fixes for jinja
rmccar Jun 28, 2024
e9ae2c1
Merge branch 'main' into add-formatting-for-nunjucks-files
alessioventuriniAND Jul 2, 2024
8a69c0c
Merge branch 'main' into add-formatting-for-nunjucks-files
alessioventuriniAND Jul 3, 2024
bda325c
another var name fixed
rmccar Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert social list changes
rmccar committed Jun 27, 2024
commit 5ec93079561a3855b48761c5be695d00ee5d167a
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/components/list/_list.scss
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@
&:last-child {
margin-bottom: -0.5;
}
&--social {
align-items: center !important;
}
}

&--spacious {
@@ -71,6 +68,12 @@
}
}

&--social & {
&__item {
align-items: center;
}
}

&--icons {
margin-bottom: 0;
.ons-list__item {
2 changes: 1 addition & 1 deletion src/components/list/_macro-options.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
| id | string | false | The HTML `id` for the wrapping element |
| classes | string | false | Classes to be added to the wrapping element |
| itemsList | `Array<ListItem>` | true | Settings for each [list item](#listitem) |
| variants | array or string | false | An array of values or single value (string) to adjust the component using available variants: “bare”, “dashed”, “inline”, and “languages” |
| variants | array or string | false | An array of values or single value (string) to adjust the component using available variants: “bare”, “dashed”, “inline”, “social”, and “languages” |
| iconPosition | string | false | Sets position of icon to “before” or “after” each list item |
| iconType | string | false | Adds an icon to all the list items when set to the name of one of the [available icons](/foundations/icons#a-to-z). Requires `iconPosition` to be set. |
| iconSize | string | false | Icon size can be set to match the size of the list item text as detailed in the [typography type scale](/foundations/typography/#type-scale). |
9 changes: 1 addition & 8 deletions src/components/list/_macro.njk
Original file line number Diff line number Diff line change
@@ -109,15 +109,8 @@
{% endif %}
{% endset %}

{% if itemIconType in ['facebook', 'twitter', 'instagram', 'linkedin'] %}
{% set socialClass = ' ons-list__item--social' %}
{% endif %}

{% if listLength > 1 or listEl == 'ul' %}
<li
class="ons-list__item{{ ' ' + item.listClasses if item.listClasses }}{{ socialClass }}"
{% if item.current %}aria-current="true"{% endif %}
>
<li class="ons-list__item{{ ' ' + item.listClasses if item.listClasses }}" {% if item.current %}aria-current="true"{% endif %}>
{{- listItem | safe -}}
</li>
{% else %}
17 changes: 0 additions & 17 deletions src/components/list/_macro.spec.js
Original file line number Diff line number Diff line change
@@ -613,23 +613,6 @@ describe('macro: list', () => {

expect($('#first + .ons-list__suffix').length).toBe(1);
});

it('has the social class added when social icons are used', () => {
const $ = cheerio.load(
renderComponent('list', {
iconPosition: 'before',
iconSize: 'xxl',
itemsList: [
{ text: 'Facebook', iconType: 'facebook' },
{ text: 'Twitter', iconType: 'twitter' },
{ text: 'Instagram', iconType: 'instagram' },
{ text: 'LinkedIn', iconType: 'linkedin' },
],
}),
);

expect($('.ons-list__item--social').length).toBe(4);
});
});

describe('nested list element', () => {
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
{
"id": 'follow-us',
"title": 'Follow us',
"variants": 'social',
"iconPosition": 'before',
"iconSize": 'xxl',
"itemsList": [