[Feature]: Add emotion position function types
See original GitHub issuePackage Scope
- Add to an existing package
- New package
Package name: react/emotion-utils
Overview
I want to like code like this position({top:10,bottom:8})
But position function did not support this type.
Describe the solution you’d like
I want to add this code.
export function position(coordinates: Coordinates): SerializedStyles;`
const [top, right, bottom, left] = (() => {
// position(coordinates)
if (typeof positionOrTopOrCoordinates === 'object') {
return [
positionOrTopOrCoordinates.top,
positionOrTopOrCoordinates.right,
positionOrTopOrCoordinates.bottom,
positionOrTopOrCoordinates.left,
];
}
and test code
it('position({top: 0, left: 0})', () => {
const { getByTestId } = render(<div data-testid="test" css={position({ top: 0, left: 0 })} />);
const el = getByTestId('test');
expect(el).toBeInTheDocument();
expect(el).toHaveStyleRule('top', '0');
expect(el).not.toHaveStyleRule('bottom', '0');
expect(el).not.toHaveStyleRule('right', '0');
expect(el).toHaveStyleRule('left', '0');
});
Additional context
I think toss team may not agree my opinion. So I open an issue, not pr. Thank you
Issue Analytics
- State:
- Created a year ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
Ability to insert styles at a specific position in <head> #2037
The problem I see that @emotion/cache provides a container option, which seems like it's useful for having some control over the DOM element ......
Read more >Emotion – Introduction
Emotion is a library designed for writing css styles with JavaScript. It provides powerful and predictable style composition in addition to a great ......
Read more >Compound facial expressions of emotion - PNAS
Past research on facial expressions of emotion has focused on the study of six basic categories—happiness, surprise, anger, sadness, fear, and ...
Read more >Emotion Regulation through Movement: Unique Sets of ...
In conclusion, our study has identified sets of motor characteristics that predict the elicitation or enhancement of each of the emotions: anger ...
Read more >What Is an Interjection Word? Function, Examples, & Types
The definition of an interjection is a word (or short phrase) whose function is to insert excitement, or another strong emotion, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
absolute
,fixed
andsticky
. Because other values are not used withtop
,left
,right
andbottom
in general.Thanks. Take your time!