-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dynamic styles to benchmarks fixture
- Loading branch information
1 parent
95feb9f
commit 7ffc04b
Showing
3 changed files
with
49 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
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,44 @@ | ||
/** | ||
* 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'; | ||
|
||
export const lotsOfStylesDynamic = [ | ||
stylex.create({ | ||
// Dynamic styles | ||
dynamicHeight: (height) => ({ | ||
height, | ||
}), | ||
dynamicPadding: (paddingTop, paddingBottom) => ({ | ||
paddingTop, | ||
paddingBottom, | ||
}), | ||
dynamicTextColor: (textColor) => ({ | ||
color: textColor, | ||
}), | ||
}), | ||
stylex.create({ | ||
// Mixed dynamic and regular styles | ||
dynamicHeightWithStatic: (height) => ({ | ||
height, | ||
backgroundColor: 'var(--background-color)', | ||
}), | ||
dynamicPaddingWithStatic: (paddingTop, paddingBottom) => ({ | ||
paddingTop, | ||
paddingBottom, | ||
margin: '8px', | ||
}), | ||
dynamicTextColorWithStatic: (textColor) => ({ | ||
color: textColor, | ||
fontSize: '16px', | ||
}), | ||
}), | ||
]; |
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