-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
145 additions
and
2 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,17 @@ | ||
{ | ||
"name": "vite-example", | ||
"version": "0.0.0", | ||
"description": "A simple rollup example to test stylexjs/vite-plugin", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "vite build" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@stylexjs/stylex": "0.3.0" | ||
}, | ||
"devDependencies": { | ||
"vite": "^5.0.6", | ||
"@stylexjs/vite-plugin": "0.0.0" | ||
} | ||
} |
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,40 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import * as stylex from '@stylexjs/stylex'; | ||
import otherStyles from './npmStyles.js'; | ||
import npmStyles from './npmStyles'; | ||
|
||
const fadeAnimation = stylex.keyframes({ | ||
'0%': { | ||
opacity: 0.25, | ||
}, | ||
'100%': { | ||
opacity: 1, | ||
}, | ||
}); | ||
|
||
const styles = stylex.create({ | ||
foo: { | ||
animationName: fadeAnimation, | ||
display: 'flex', | ||
marginStart: 10, | ||
marginBlockStart: 99, | ||
height: 500, | ||
':hover': { | ||
background: 'red', | ||
}, | ||
}, | ||
}); | ||
|
||
export default function App() { | ||
return stylex.props(otherStyles.bar, styles.foo, npmStyles.baz).className; | ||
} |
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,21 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import * as stylex from '@stylexjs/stylex'; | ||
|
||
const styles = stylex.create({ | ||
bar: { | ||
display: 'block', | ||
width: '100%', | ||
}, | ||
}); | ||
|
||
export default styles; |
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,21 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import * as stylex from '@stylexjs/stylex'; | ||
|
||
const styles = stylex.create({ | ||
bar: { | ||
display: 'block', | ||
width: '100%', | ||
}, | ||
}); | ||
|
||
export default styles; |
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,22 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* | ||
*/ | ||
import { defineConfig } from 'vite' | ||
import stylexPlugin from '@stylexjs/vite-plugin' | ||
import path from 'path' | ||
|
||
export default defineConfig({ | ||
plugins: [stylexPlugin()], | ||
build: { | ||
lib: { | ||
entry: path.join(__dirname, 'src/index.js'), | ||
formats: ['es'] | ||
}, | ||
outDir: path.join(__dirname, '.build') | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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