-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mixins] Memoize
useEuiButtonFocusCSS
+ fix animation relying on existing Sass CSS instead of generating actual keyframes from Emotion
- Loading branch information
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/themes/amsterdam/global_styling/mixins/__snapshots__/button.test.ts.snap
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,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`useEuiButtonFocusCSS 1`] = ` | ||
Object { | ||
"map": undefined, | ||
"name": "1s8jae7-focusCSS", | ||
"next": Object { | ||
"name": "animation-70pju1", | ||
"next": undefined, | ||
"styles": "@keyframes animation-70pju1{ | ||
50% { | ||
transform: translateY(1px); | ||
} | ||
}", | ||
}, | ||
"styles": "@media screen and (prefers-reduced-motion: no-preference){transition:transform 250ms ease-in-out,background-color 250ms ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:animation-70pju1 250ms cubic-bezier(.34, 1.61, .7, 1);}&:active:not(:disabled){transform:translateY(1px);}};", | ||
"toString": [Function], | ||
} | ||
`; |
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,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { renderHook } from '@testing-library/react'; | ||
|
||
import { useEuiButtonFocusCSS } from './button'; | ||
|
||
test('useEuiButtonFocusCSS', () => { | ||
const { result } = renderHook(() => useEuiButtonFocusCSS()); | ||
expect(result.current).toMatchSnapshot(); | ||
}); |
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