mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 06:42:14 +00:00
removed annoying focus on buttons 2
This commit is contained in:
1 parent
4ab6ca1caa
commit
3556dcbfd3
3 files changed
+26
-6
No files matched your search
@@ -6,6 +6,21 @@
|
||||
:root {
|
||||
@apply select-none bg-ui-background font-sans text-white;
|
||||
}
|
||||
|
||||
/* Remove all focus styles */
|
||||
button {
|
||||
@apply outline-none ring-0;
|
||||
-webkit-tap-highlight-color: transparent !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
@apply outline-none ring-0;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.pegboard {
|
||||
background-image: radial-gradient(#ffffff25 1px, transparent 0);
|
||||
background-color: #1b1b1f;
|
||||
|
||||
@@ -44,7 +44,7 @@ export const ToolbarButton = ({
|
||||
}
|
||||
|
||||
const mergedButtonClasses = twMerge(
|
||||
"rounded-lg hover:bg-white/15 transition-all duration-100 border-2 border-transparent text-white/80 px-2 focus-visible:ring-0 focus-visible:ring-offset-0",
|
||||
"rounded-lg hover:bg-white/15 transition-all duration-100 border-2 border-transparent text-white/80 px-2",
|
||||
children ? "w-fit flex items-center gap-2.5 text-nowrap" : "size-10",
|
||||
active && "bg-primary/30 border-2 border-primary hover:bg-primary/30",
|
||||
disabled && "pointer-events-none text-secondary-300",
|
||||
@@ -58,6 +58,12 @@ export const ToolbarButton = ({
|
||||
className={mergedButtonClasses}
|
||||
disabled={disabled}
|
||||
autoFocus={false}
|
||||
tabIndex={-1}
|
||||
style={{
|
||||
outline: "none",
|
||||
boxShadow: "none",
|
||||
WebkitTapHighlightColor: "transparent",
|
||||
}}
|
||||
{...restButtonProps}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -28,17 +28,17 @@ export const Button = ({
|
||||
function getVariantClassNames(variant: string) {
|
||||
switch (variant) {
|
||||
case "tertiary": {
|
||||
return "bg-tertiary hover:bg-tertiary-400 text-white focus-visible:outline-tertiary-600";
|
||||
return "bg-tertiary hover:bg-tertiary-400 text-white";
|
||||
}
|
||||
case "secondary": {
|
||||
return "bg-ui-controls hover:bg-ui-controls/80 text-white focus-visible:outline-secondary";
|
||||
return "bg-ui-controls hover:bg-ui-controls/80 text-white";
|
||||
}
|
||||
case "action": {
|
||||
return " bg-action hover:bg-action-500 text-white focus-visible:outline-action";
|
||||
return "bg-action hover:bg-action-500 text-white";
|
||||
}
|
||||
case "primary":
|
||||
default: {
|
||||
return "bg-primary hover:bg-primary-600 text-white focus-visible:outline-primary-600";
|
||||
return "bg-primary hover:bg-primary-600 text-white";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,6 @@ export const Button = ({
|
||||
"text-[15px] font-semibold rounded-lg px-3 py-2 shadow-sm",
|
||||
"flex gap-2 items-center justify-center",
|
||||
"transition-all duration-150",
|
||||
"focus-visible:ring-0 focus-visible:ring-offset-0",
|
||||
getVariantClassNames(propsVariant),
|
||||
propsClassName,
|
||||
disabledClass,
|
||||
|
||||
Reference in new issue
Block a user