-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove regex lookbehinds to support Safari 16.3 or older (#298)
* Remove regex lookbehinds * Refactor regex * Fix _addPseudoRule and refactor some tests * Fix changeset
- Loading branch information
Showing
5 changed files
with
45 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kuma-ui/sheet": patch | ||
--- | ||
|
||
Remove regex lookbehinds to support Safari <= 16.3 and some refactoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// removes white space around property values | ||
export const cssPropertyRegex = /(?<=:)\s+|\s+(?=;)/g; | ||
export const removeSpacesAroundCssPropertyValues = (css: string) => { | ||
const regex = /(:)\s+|\s+(?=;)/g; | ||
return css.replace(regex, "$1"); | ||
}; | ||
|
||
// removes whitespace except around CSS property values and after commas. | ||
export const removeSpacesExceptInPropertiesRegex = | ||
/(?<=:)\s+|\s+(?=;)|(?<=\{)\s+|\s+(?=\})|(?<=,)\s+|\s+(?=,)|\s+(?={)/g; | ||
export const removeSpacesExceptInProperties = (css: string) => { | ||
const regex = /(:)\s+|\s+(?=;)|(\{)\s+|\s+(?=\})|(,)\s+|\s+(?=,)|\s+(?={)/g; | ||
return css.replace(regex, "$1$2$3"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3414300
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
kuma-ui-website – ./
kuma-ui-website-git-main-musclenote.vercel.app
kuma-ui.com
kuma-ui-website.vercel.app
www.kuma-ui.com
kuma-ui-website-musclenote.vercel.app