MCPcopy Create free account
hub / github.com/microsoft/SandDance / _getFocusStyleInternal

Function _getFocusStyleInternal

docs/app/js/sanddance-app.js:28477–28507  ·  view source on GitHub ↗
(theme, options)

Source from the content-addressed store, hash-verified

28475 else return _getFocusStyleInternal(theme, insetOrOptions);
28476}
28477function _getFocusStyleInternal(theme, options) {
28478 var _a, _b;
28479 if (options === void 0) options = {};
28480 var _c = options.inset, inset = _c === void 0 ? 0 : _c, _d = options.width, width = _d === void 0 ? 1 : _d, _e = options.position, position = _e === void 0 ? "relative" : _e, highContrastStyle = options.highContrastStyle, _f = options.borderColor, borderColor = _f === void 0 ? theme.palette.white : _f, _g = options.outlineColor, outlineColor = _g === void 0 ? theme.palette.neutralSecondary : _g, _h = options.isFocusedOnly, isFocusedOnly = _h === void 0 ? true : _h;
28481 return {
28482 // Clear browser-specific focus styles and use 'transparent' as placeholder for focus style.
28483 outline: "transparent",
28484 // Requirement because pseudo-element is absolutely positioned.
28485 position: position,
28486 selectors: (_a = {
28487 // Clear the focus border in Firefox.
28488 // Reference: http://stackoverflow.com/a/199319/1436671
28489 "::-moz-focus-inner": {
28490 border: "0"
28491 }
28492 }, // When the element that uses this mixin is in a :focus state, add a pseudo-element to
28493 // create a border.
28494 _a["." + (0, _utilities.IsFocusVisibleClassName) + " &" + (isFocusedOnly ? ":focus" : "") + ":after"] = {
28495 content: '""',
28496 position: "absolute",
28497 left: inset + 1,
28498 top: inset + 1,
28499 bottom: inset + 1,
28500 right: inset + 1,
28501 border: width + "px solid " + borderColor,
28502 outline: width + "px solid " + outlineColor,
28503 zIndex: (0, _zIndexes.ZIndexes).FocusStyle,
28504 selectors: (_b = {}, _b[0, _commonStyles.HighContrastSelector] = highContrastStyle, _b)
28505 }, _a)
28506 };
28507}
28508function focusClear() {
28509 return {
28510 selectors: {

Callers 1

getFocusStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected