Skip to content

Commit 71a9bac

Browse files
RAC: swap custom outline variant for ui library secondary (#1254)
* Use the library's `secondary` for the default button variant The app preset's `outline` variant had no pressed state, so the Save button and every other default-variant button gave no press feedback. It went missing in the Chakra port. The old `outline` was a partial override of Chakra's own `outline`, and `extendTheme` deep-merges function variants by calling both — so it inherited `_active: { bg: <colorScheme>.100 }` from the `ghost` variant Chakra's outline spreads. It set `_hover.bg: transparent` to suppress ghost's hover wash but left `_active` alone, so read as a standalone definition there was nothing to suggest a pressed state existed. Rather than restate it, drop the fork: the difference from the library's `secondary` is text one stop darker at rest, and hover darkening the border instead of the text. 0.17% of pixels change and nothing moves. The three explicit `variant="outline"` sites in the simulator action bar move to `secondary` with it. Needs the paired brand.50 alias in the private theme package, or the pressed wash resolves to Chakra blue. * Bump private preset for brand.50 stop
1 parent 64ba956 commit 71a9bac

3 files changed

Lines changed: 4 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- run: npm ci
4141
env:
4242
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
- run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-experiment.rai.66 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1
43+
- run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-experiment.rai.67 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1
4444
if: github.repository_owner == 'microbit-foundation'
4545
env:
4646
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/deployment/default/panda-preset.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ export const appPreset = definePreset({
109109
button: {
110110
variants: {
111111
variant: {
112-
outline: {
113-
borderWidth: "2px",
114-
borderColor: "currentColor",
115-
color: "brand.500",
116-
bg: "transparent",
117-
_hover: { color: "brand.600", bg: "transparent" },
118-
},
119112
// Icon buttons on the app's dark chrome (sidebar header,
120113
// serial bar): white glyph, white pill on hover. The Chakra
121114
// variant was ghost-based with callers passing color="white";
@@ -143,7 +136,6 @@ export const appPreset = definePreset({
143136
},
144137
},
145138
},
146-
defaultVariants: { variant: "outline" },
147139
},
148140
},
149141
},

src/simulator/SimulatorActionBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const SimulatorActionBar = ({
9292
>
9393
<IconButton
9494
size={size}
95-
variant="outline"
95+
variant="secondary"
9696
onPress={() => handleStop("user")}
9797
aria-label={intl.formatMessage({ id: "simulator-stop" })}
9898
isDisabled={running === RunningStatus.STOPPED}
@@ -101,7 +101,7 @@ const SimulatorActionBar = ({
101101
</IconButton>
102102
<IconButton
103103
size={size}
104-
variant="outline"
104+
variant="secondary"
105105
onPress={device.reset}
106106
aria-label={intl.formatMessage({ id: "simulator-reset" })}
107107
isDisabled={running === RunningStatus.STOPPED}
@@ -110,7 +110,7 @@ const SimulatorActionBar = ({
110110
</IconButton>
111111
<IconButton
112112
size={size}
113-
variant="outline"
113+
variant="secondary"
114114
onPress={handleMuteUnmute}
115115
aria-label={
116116
isMuted

0 commit comments

Comments
 (0)