Skip to content

Commit

Permalink
feat(style): enhance stateHover, stateActive
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Jul 26, 2023
1 parent db076dd commit 0aa3ee1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ui/style/lib/state-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ export const stateLayerPlugin = plugin(({matchUtilities, theme}) => {
},
};
},
stateHover: (value) => {
if (typeof value !== 'function') return null;
const makeColor = value as unknown as (options: {opacityValue: number}) => string;
const color = makeColor({opacityValue: stateOpacity.hover});
return {
backgroundImage: `linear-gradient(${color}, ${color})`,
};
},
stateActive: (value) => {
if (typeof value !== 'function') return null;
const makeColor = value as unknown as (options: {opacityValue: number}) => string;
const color = makeColor({opacityValue: stateOpacity.pressed});
return {
backgroundImage: `linear-gradient(${color}, ${color})`,
};
},
},
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down

0 comments on commit 0aa3ee1

Please sign in to comment.