Skip to content

Commit

Permalink
fix(block-section): wraps long text over to a new line when toggle sw…
Browse files Browse the repository at this point in the history
…itch is displayed (#8101)

**Related Issue:** #7698 

## Summary

Wraps long text to a new line when `toggle-display='switch'`
  • Loading branch information
anveshmekala authored Nov 3, 2023
1 parent 73271a1 commit 3f90780
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

.toggle--switch-container {
@apply flex items-center relative bg-transparent w-full;
word-break: break-word;

.focus-guard {
--calcite-label-margin-bottom: 0;
Expand Down Expand Up @@ -89,4 +90,10 @@
color: theme("colors.danger");
}

:host([toggle-display="switch"]) .toggle {
.toggle--switch__content {
@apply me-7;
}
}

@include base-component();
12 changes: 12 additions & 0 deletions packages/calcite-components/src/components/block/block.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,15 @@ export const scrollingContainerSetup_TestOnly = (): string => html`<style>
</script>`;

scrollingContainerSetup_TestOnly.parameters = { chromatic: { delay: 500 } };

export const toggleDisplayWithLongText_TestOnly = (): string => html`<calcite-block
open
heading="Calcite block"
style="width:150px"
>
<calcite-block-section id="block-section" open text="Calcite block superlongggggtext" toggle-display="switch">
<calcite-notice open>
<div slot="message">Some more complex options.</div>
</calcite-notice>
</calcite-block-section>
</calcite-block>`;

0 comments on commit 3f90780

Please sign in to comment.