Skip to content

Commit

Permalink
fix: list style type
Browse files Browse the repository at this point in the history
  • Loading branch information
SiTaggart committed Jul 11, 2023
1 parent 83307d2 commit 05ac037
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/cool-eyes-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/text': patch
'@twilio-paste/core': patch
---

[Text] exposing missing typography style properties that are allowed via typescript, but aren't actually implemented on the component. These include list-style-type, textOverflow and overflowWrap
13 changes: 13 additions & 0 deletions packages/paste-core/components/list/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ describe('Ordered List', () => {
expect(renderedList).toHaveStyleRule('margin-bottom', '0.75rem');
});

it('should set list style type styles to combat css reset stylesheets', () => {
render(
<CustomizationProvider baseTheme="default" theme={TestTheme}>
<OrderedList data-testID="ordered-list">Children</OrderedList>
<UnorderedList data-testID="unordered-list">Children</UnorderedList>
</CustomizationProvider>
);
const renderedOrderedList = screen.getByTestId('ordered-list');
const renderedUnorderedList = screen.getByTestId('unordered-list');
expect(renderedOrderedList).toHaveStyleRule('list-style-type', 'decimal');
expect(renderedUnorderedList).toHaveStyleRule('list-style-type', 'disc');
});

it('should allow aria attributes', () => {
render(<OrderedList aria-expanded="true">Children</OrderedList>);
const renderedList = screen.getByRole('list');
Expand Down
5 changes: 5 additions & 0 deletions packages/paste-core/primitives/text/src/CustomStyleProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ export const customStyleProps = {
wordBreak: true,
wordWrap: true,
fontVariantNumeric: true,
textOverflow: true,
overflowWrap: true,
listStyleType: true,
listStylePosition: true,
listStyleImage: true,
};

0 comments on commit 05ac037

Please sign in to comment.