Skip to content

Commit

Permalink
feat(styled-system): add first-letter pseudo (#7441)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeferson-sb committed Mar 17, 2023
1 parent 275c450 commit 600ec11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-bags-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chakra-ui/styled-system": patch
---

Add ::first-letter pseudo element to style props
10 changes: 10 additions & 0 deletions packages/core/styled-system/src/pseudos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ export const pseudoSelectors = {
* Styles for CSS Selector `&:first-of-type`
*/
_first: "&:first-of-type",
/**
* Styles for CSS selector `&::first-letter`
*
* NOTE: This selector is only applied for block-level elements and not preceded by an image or table.
* @example
* ```jsx
* <Text _firstLetter={{ textDecoration: 'underline' }}>Once upon a time</Text>
* ```
*/
_firstLetter: "&::first-letter",
/**
* Styles for CSS Selector `&:last-of-type`
*/
Expand Down

1 comment on commit 600ec11

@vercel
Copy link

@vercel vercel bot commented on 600ec11 Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.