borderColor method
Color?
borderColor(
- OptimusTokens tokens, {
- required bool isEnabled,
- required bool isPressed,
- required bool isHovered,
Implementation
Color? borderColor(
OptimusTokens tokens, {
required bool isEnabled,
required bool isPressed,
required bool isHovered,
}) {
switch (this) {
case OptimusButtonVariant.primary:
case OptimusButtonVariant.ghost:
case OptimusButtonVariant.danger:
return null;
case OptimusButtonVariant.secondary:
if (!isEnabled) return tokens.borderDisabled;
if (isPressed) return tokens.borderInteractivePrimaryActive;
if (isHovered) return tokens.borderInteractivePrimaryHover;
return tokens.borderInteractivePrimaryDefault;
case OptimusButtonVariant.tertiary:
if (!isEnabled) return tokens.borderDisabled;
if (isPressed) return tokens.borderInteractiveSecondaryActive;
if (isHovered) return tokens.borderInteractiveSecondaryHover;
return tokens.borderInteractiveSecondaryDefault;
}
}