-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SX: Vendor prefixes via Autoprefixer
Vendor prefixes are automatically added into the generated CSS.
- Loading branch information
1 parent
e565bb0
commit 96daef5
Showing
14 changed files
with
209 additions
and
16 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
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
24 changes: 24 additions & 0 deletions
24
src/sx-tailwind-website/src/TailwindCss/gradients/TextBackground.js
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,24 @@ | ||
// @flow | ||
|
||
import type { Node } from 'react'; | ||
import { tailwind } from '@adeira/sx-tailwind'; | ||
|
||
export default function TextBackground(): Node { | ||
return ( | ||
<h1 className={tailwind('text-6xl font-bold')}> | ||
<span | ||
className={tailwind( | ||
'bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500', | ||
)} | ||
> | ||
Greetings from SX Tailwind | ||
</span> | ||
</h1> | ||
); | ||
} | ||
|
||
export const code = `<h1 className={tailwind('text-6xl font-bold')}> | ||
<span className={tailwind('bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500')}> | ||
Greetings from SX Tailwind | ||
</span> | ||
</h1>`; |
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
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,49 @@ | ||
// @flow | ||
|
||
/* global document */ | ||
|
||
import { render } from '@testing-library/react'; | ||
|
||
import sx from '../../index'; | ||
|
||
it('autoprefix runtime styles', () => { | ||
render(<style data-adeira-sx />); | ||
|
||
const styleTag = document.querySelector('style'); | ||
expect(styleTag?.sheet?.cssRules).toHaveLength(0); | ||
|
||
sx.create({ | ||
test: { | ||
backgroundClip: 'text', | ||
}, | ||
}); | ||
|
||
expect(styleTag?.sheet?.cssRules).toHaveLength(1); | ||
expect(styleTag?.sheet?.cssRules).toMatchInlineSnapshot(` | ||
Array [ | ||
CSSStyleRule { | ||
"__ends": 59, | ||
"__starts": 0, | ||
"parentRule": null, | ||
"parentStyleSheet": CSSStyleSheet { | ||
"cssRules": [Circular], | ||
"parentStyleSheet": null, | ||
}, | ||
"selectorText": "._2D4soO", | ||
"style": CSSStyleDeclaration { | ||
"-webkit-background-clip": "text", | ||
"0": "-webkit-background-clip", | ||
"1": "background-clip", | ||
"__starts": 8, | ||
"_importants": Object { | ||
"-webkit-background-clip": "", | ||
"background-clip": "", | ||
}, | ||
"background-clip": "text", | ||
"length": 2, | ||
"parentRule": [Circular], | ||
}, | ||
}, | ||
] | ||
`); | ||
}); |
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,9 @@ | ||
// @flow | ||
|
||
import type { SheetDefinitions } from '../../create'; | ||
|
||
export default ({ | ||
title: { | ||
backgroundClip: 'text', | ||
}, | ||
}: SheetDefinitions); |
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
Oops, something went wrong.