Skip to content

Commit

Permalink
fix: improve filter list
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Jun 2, 2020
1 parent 193a1ff commit f5cae60
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 72 deletions.
12 changes: 6 additions & 6 deletions src/assets/styles/components/_filter-sort.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
}

.accordion--filter-list {
.accordion__content > .input-group li ul {
margin-top: rem(12);
padding-left: rem(30);
}

@include breakpoint-down(md) {
.accordion__heading {
--border-width: #{rem(1)};
Expand Down Expand Up @@ -122,7 +127,7 @@
margin-right: ($gutter * -1);
margin-top: rem(12);
padding-bottom: rem(6);
padding-left: rem(70);
padding-left: rem(40);
padding-top: rem(6);
width: calc(100% + #{($gutter * 2)});
}
Expand All @@ -148,11 +153,6 @@
top: rem(9);
}

.accordion__content > .input-group li ul {
margin-top: rem(12);
padding-left: rem(30);
}

.accordion__content > .input-group li [aria-expanded="false"] + ul {
display: none;
}
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/components/inputs/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ input[type="checkbox"] {
.checkbox label,
input[type="checkbox"] + label,
[role="checkbox"] {
cursor: default;
font-weight: $font-weight-normal;
}

Expand Down
147 changes: 81 additions & 66 deletions src/components/20-molecules/71-filter-list/filter-list.config.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,89 @@
const slugify = require( 'slugify' );

const terms = [
{
label: 'Cooperative essentials',
children: [
'Governance',
'Ownership',
'Cooperative best practices',
'Diversity and inclusion',
'Bylaws',
]
},
{
label: 'Business operations',
children: [
'Human resources',
'Marketing',
'Social media',
'Incorporation',
'Business model',
'Income, benefits, and compensation'
]
},
{
label: 'Technology & Platforms',
children: [
'Software development',
'Platforms',
'Design',
'Free software',
'Data',
'Algorithms',
'Automation',
'Blockchain',
'Search engines'
]
},
{
label: 'Law & Policy',
children: [
'Anti-trust',
'Labor law',
'Policy',
'Co-op law'
]
},
{
label: 'Fair labour',
children: [
'Unions',
'Workplace safety',
'Social security',
]
},
{
label: 'Platform co-op theory',
children: [
'Platform cooperativism',
'Platform capitalism',
'Gig economy',
'Sharing economy',
'Solidarity economy',
'Information economy',
'Peer-to-peer'
]
},
];

terms.forEach( term => {
const name = slugify( term.label, { lower: true } );
term.children = term.children.map( child => {
return {
value: slugify( child, { lower: true } ),
label: child,
name
};
} );
} );

module.exports = {
name: 'Filter List',
status: 'wip',
context: {
label: 'Topics',
terms: [
{
label: 'Cooperative essentials',
children: [
'Governance',
'Ownership',
'Cooperative best practices',
'Diversity and inclusion',
'Bylaws',
]
},
{
label: 'Business operations',
children: [
'Human resources',
'Marketing',
'Social media',
'Incorporation',
'Business model',
'Income, benefits, and compensation'
]
},
{
label: 'Technology & Platforms',
children: [
'Software development',
'Platforms',
'Design',
'Free software',
'Data',
'Algorithms',
'Automation',
'Blockchain',
'Search engines'
]
},
{
label: 'Law & Policy',
children: [
'Anti-trust',
'Labor law',
'Policy',
'Co-op law'
]
},
{
label: 'Fair labour',
children: [
'Unions',
'Workplace safety',
'Social security',
]
},
{
label: 'Platform co-op theory',
children: [
'Platform cooperativism',
'Platform capitalism',
'Gig economy',
'Sharing economy',
'Solidarity economy',
'Information economy',
'Peer-to-peer'
]
},
],
terms,
standAlone: false,
}
};

0 comments on commit f5cae60

Please sign in to comment.