Skip to content

Commit

Permalink
Add non-clickable filter tag
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed Nov 21, 2024
1 parent a128164 commit b0b50c1
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 29 deletions.
7 changes: 7 additions & 0 deletions docs/pages/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ variation_groups:
</a>
</li>
</ul>
- variation_is_deprecated: false
variation_name: Non-clickable filter tag
variation_description: There can be elements that have the appearance of a filter tag, but are not clickable. This is used like an inline notification.
variation_code_snippet: >-
<div class="a-tag-filter">
Option 1
</div>
variation_group_name: Types
behavior: To clear a filter tag selection, click the “x” icon inside of the filter tag.
related_items: >-
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/index.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cfpb-design-system/dist/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/utilities/index.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cfpb-design-system/dist/utilities/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cfpb-design-system/dist/utilities/index.js.map

Large diffs are not rendered by default.

28 changes: 15 additions & 13 deletions packages/cfpb-design-system/src/components/cfpb-forms/tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
text-align: left;
min-width: fit-content;

.cf-icon-svg {
pointer-events: none;

// Prevent flexbox from squishing icon when tag text is long.
flex: none;
}

// If the contents are wrapped in a label, negate the label's display.
> label {
display: contents;
pointer-events: none;
}
}

button.a-tag-filter {
&:hover {
background-color: var(--teal-40);
cursor: pointer;
Expand All @@ -29,19 +44,6 @@
&:active {
background-color: var(--teal);
}

.cf-icon-svg {
pointer-events: none;

// Prevent flexbox from squishing icon when tag text is long.
flex: none;
}

// If the contents are wrapped in a label, negate the label's display.
> label {
display: contents;
pointer-events: none;
}
}

a.a-tag-filter {
Expand Down

0 comments on commit b0b50c1

Please sign in to comment.