Skip to content

Commit

Permalink
Merge pull request #4428 from grommet/focusIndicator-tokens
Browse files Browse the repository at this point in the history
Add focusIndicator.outlineOffset and boxShadow
  • Loading branch information
taysea authored Nov 19, 2024
2 parents fe3fb13 + ceaa46a commit 40aa188
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 19 deletions.
1 change: 1 addition & 0 deletions design-tokens/src/transforms/numberToDimension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const numberToDimension: Transform = {
'borderRadius',
'borderWidth',
'breakpoint',
'outlineOffset',
].find(v => token.path.includes(v))
)
return true;
Expand Down
32 changes: 32 additions & 0 deletions design-tokens/tokens/semantic/global.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,38 @@
"codeSyntax": {}
}
}
},
"outlineOffset": {
"$type": "number",
"$value": 2,
"$description": "",
"$extensions": {
"com.figma": {
"hiddenFromPublishing": true,
"scopes": [],
"codeSyntax": {}
}
}
},
"boxShadow": {
"$type": "shadow",
"$value": [
{
"color": "white",
"offsetX": 0,
"offsetY": 0,
"blur": 0,
"spread": "{focusIndicator.outlineOffset}"
}
],
"$description": "",
"$extensions": {
"com.figma": {
"hiddenFromPublishing": true,
"scopes": [],
"codeSyntax": {}
}
}
}
},
"fontStack": {
Expand Down
6 changes: 6 additions & 0 deletions sandbox/native-web/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
transition-timing-function: cubic-bezier(0.3, 0, 0.8, 0.15); */
}

:focus-visible {
outline: var(--hpe-focus-indicator-outline);
outline-offset: var(--hpe-focus-indicator-outline-offset);
box-shadow: var(--hpe-focus-indicator-box-shadow);
}

body {
margin: 0;
min-height: 100vh;
Expand Down
4 changes: 3 additions & 1 deletion sandbox/tailwind-app/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
width: 100%;
}
:focus-visible {
outline: 2px auto var(--hpe-focus-ring-color);
outline: var(--hpe-focus-indicator-outline);
outline-offset: var(--hpe-focus-indicator-outline-offset);
box-shadow: var(--hpe-focus-indicator-box-shadow);
}

a {
Expand Down
61 changes: 43 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3646,9 +3646,9 @@
"@types/node" "*"

"@types/node@*", "@types/node@^22.0.0":
version "22.9.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.9.0.tgz#b7f16e5c3384788542c72dc3d561a7ceae2c0365"
integrity sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==
version "22.9.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.9.1.tgz#bdf91c36e0e7ecfb7257b2d75bf1b206b308ca71"
integrity sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==
dependencies:
undici-types "~6.19.8"

Expand Down Expand Up @@ -6047,9 +6047,9 @@ ejs@^3.1.10:
jake "^10.8.5"

electron-to-chromium@^1.5.41:
version "1.5.62"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.62.tgz#8289468414b0b0b3e9180ef619a763555debe612"
integrity sha512-t8c+zLmJHa9dJy96yBZRXGQYoiCEnHYgFwn1asvSPZSUdVxnB62A4RASd7k41ytG3ErFBA0TpHlKg9D9SQBmLg==
version "1.5.63"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.63.tgz#69444d592fbbe628d129866c2355691ea93eda3e"
integrity sha512-ddeXKuY9BHo/mw145axlyWjlJ1UBt4WK3AlvkT7W2AbqfRQoacVoRUCF6wL3uIx/8wT9oLKXzI+rFqHHscByaA==

elegant-spinner@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -9741,9 +9741,9 @@ macos-release@^3.0.1:
integrity sha512-tPJQ1HeyiU2vRruNGhZ+VleWuMQRro8iFtJxYgnS4NQe+EukKF6aGiIT+7flZhISAt2iaXBCfFGvAyif7/f8nQ==

magic-string@^0.30.5:
version "0.30.12"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.12.tgz#9eb11c9d072b9bcb4940a5b2c2e1a217e4ee1a60"
integrity sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==
version "0.30.13"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.13.tgz#92438e3ff4946cf54f18247c981e5c161c46683c"
integrity sha512-8rYBO+MsWkgjDSOvLomYnzhdwEG51olQ4zL5KXnNJWV5MNmrb4rTZdrtkhxjnD/QyZUqR/Z/XDsUs/4ej2nx0g==
dependencies:
"@jridgewell/sourcemap-codec" "^1.5.0"

Expand Down Expand Up @@ -10392,9 +10392,9 @@ micromark-util-sanitize-uri@^2.0.0:
micromark-util-symbol "^2.0.0"

micromark-util-subtokenize@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.2.tgz#ea5e3984b96b13cda7b1329763e15f3b4a4e063b"
integrity sha512-xKxhkB62vwHUuuxHe9Xqty3UaAsizV2YKq5OV344u3hFBbf8zIYrhYOWhAQb94MtMPkjTOzzjJ/hid9/dR5vFA==
version "2.0.3"
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz#70ffb99a454bd8c913c8b709c3dc97baefb65f96"
integrity sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg==
dependencies:
devlop "^1.0.0"
micromark-util-chunked "^2.0.0"
Expand Down Expand Up @@ -12723,7 +12723,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -12831,7 +12840,14 @@ stringify-entities@^4.0.0:
character-entities-html4 "^2.0.0"
character-entities-legacy "^3.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -14415,7 +14431,16 @@ word-wrap@^1.2.5, word-wrap@~1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down Expand Up @@ -14512,9 +14537,9 @@ yaml@^1.10.0:
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==

yaml@^2.2.2, yaml@^2.3.4:
version "2.6.0"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.6.0.tgz#14059ad9d0b1680d0f04d3a60fe00f3a857303c3"
integrity sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==
version "2.6.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.6.1.tgz#42f2b1ba89203f374609572d5349fb8686500773"
integrity sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==

yargs-parser@^20.2.2:
version "20.2.9"
Expand Down

0 comments on commit 40aa188

Please sign in to comment.