@sinchsmb/ui-kit
Version:
UI kit for SinchSMB frontend
20 lines (17 loc) • 526 B
text/typescript
import get from 'lodash/get';
import { OtherToken, OtherTokenRef, PropsWithTheme } from './types';
/**
* Returns other theme value that can be used inside styled-component.
*
* ```tsx
* import styled from 'styled-components/macro';
* import { other } from '../theme';
*
* const StyledDiv = styled.div`
* transition-timing-function: ${other("timingFunction/smooth")};
* `;
* ```
*/
export function other(name: OtherTokenRef) {
return (props: PropsWithTheme): OtherToken => get(props.theme, name.split('/'));
}