-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for makeResetStyles transforms (#236)
* feat: add support for makeResetStyles transforms * restore to previous condition
- Loading branch information
1 parent
48239dc
commit b360b56
Showing
19 changed files
with
279 additions
and
88 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@griffel-babel-preset-38bd5966-ba05-454d-8a03-ca57f93eb42b.json
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,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: add support for makeResetStyles transforms", | ||
"packageName": "@griffel/babel-preset", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@griffel-webpack-loader-2fb0d186-b51f-4f73-8784-982a16c6f786.json
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,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "feat: add support for makeResetStyles transforms", | ||
"packageName": "@griffel/webpack-loader", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
packages/babel-preset/__fixtures__/assets-reset-styles/code.ts
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,11 @@ | ||
import { makeResetStyles } from '@griffel/react'; | ||
|
||
import blank from './blank.jpg'; | ||
import blankDuplicate from './blank.jpg'; | ||
import empty from './empty.jpg'; | ||
|
||
export const useStyles = makeResetStyles({ | ||
backgroundImage: `url(${blank})`, | ||
':hover': { backgroundImage: `url(${blankDuplicate})` }, | ||
':focus': { backgroundImage: `url(${empty})` }, | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
packages/babel-preset/__fixtures__/assets-reset-styles/output.ts
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,11 @@ | ||
import _asset2 from './empty.jpg'; | ||
import _asset from './blank.jpg'; | ||
import { __resetStyles } from '@griffel/react'; | ||
import blank from './blank.jpg'; | ||
import blankDuplicate from './blank.jpg'; | ||
import empty from './empty.jpg'; | ||
export const useStyles = __resetStyles('ra9m047', null, [ | ||
`.ra9m047{background-image:url(${_asset});}`, | ||
`.ra9m047:hover{background-image:url(${_asset});}`, | ||
`.ra9m047:focus{background-image:url(${_asset2});}`, | ||
]); |
6 changes: 6 additions & 0 deletions
6
packages/babel-preset/__fixtures__/require-reset-styles/code.ts
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,6 @@ | ||
const react_make_styles_1 = require('@griffel/react'); | ||
|
||
export const useStyles = react_make_styles_1.makeResetStyles({ | ||
fontSize: '14px', | ||
lineHeight: 1, | ||
}); |
5 changes: 5 additions & 0 deletions
5
packages/babel-preset/__fixtures__/require-reset-styles/output.ts
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 @@ | ||
const react_make_styles_1 = require('@griffel/react'); | ||
|
||
export const useStyles = react_make_styles_1.__resetStyles('r1qlvv59', null, [ | ||
'.r1qlvv59{font-size:14px;line-height:1;}', | ||
]); |
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,6 @@ | ||
import { makeResetStyles } from '@griffel/react'; | ||
|
||
export const useStyles = makeResetStyles({ | ||
color: 'red', | ||
paddingLeft: '4px', | ||
}); |
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 @@ | ||
import { __resetStyles } from '@griffel/react'; | ||
export const useStyles = __resetStyles('rjefjbm', 'r7z97ji', [ | ||
'.rjefjbm{color:red;padding-left:4px;}', | ||
'.r7z97ji{color:red;padding-right:4px;}', | ||
]); |
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { makeResetStyles } from '@griffel/react'; | ||
import { tokens } from './tokens'; | ||
|
||
export const useStyles = makeResetStyles({ | ||
color: tokens.colorBrandStroke1, | ||
paddingLeft: '4px', | ||
}); |
Oops, something went wrong.