Skip to content

Commit

Permalink
Fixed disabled button style
Browse files Browse the repository at this point in the history
Added floating color for select and combobox
Fixed tooltip style
  • Loading branch information
bheston committed Oct 21, 2021
1 parent 6de8026 commit 6db3fc1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 10 deletions.
5 changes: 5 additions & 0 deletions packages/web-components/src/combobox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Combobox as FoundationCombobox,
comboboxTemplate as template,
} from '@microsoft/fast-foundation';
import { fillColor, neutralLayerFloating } from '../design-tokens';
import { comboboxStyles as styles } from './combobox.styles';

/**
Expand Down Expand Up @@ -46,6 +47,10 @@ export class Combobox extends FoundationCombobox {
if (!this.appearance) {
this.appearance = 'outline';
}

if (this.listbox) {
fillColor.setValueFor(this.listbox, neutralLayerFloating);
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions packages/web-components/src/select/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { attr } from '@microsoft/fast-element';
import { Select as FoundationSelect, SelectOptions, selectTemplate as template } from '@microsoft/fast-foundation';
import { fillColor, neutralLayerFloating } from '../design-tokens';
import { selectStyles as styles } from './select.styles';

/**
Expand Down Expand Up @@ -42,6 +43,10 @@ export class Select extends FoundationSelect {
if (!this.appearance) {
this.appearance = 'outline';
}

if (this.listbox) {
fillColor.setValueFor(this.listbox, neutralLayerFloating);
}
}
}

Expand Down
22 changes: 22 additions & 0 deletions packages/web-components/src/styles/patterns/button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,35 @@ export const HypertextStyles = (
line-height: 1;
text-decoration: underline 1px;
}
:host .control:not([href]) {
background-color: transparent;
}
:host .control${interactivitySelector} {
background: transparent;
color: ${accentForegroundRest};
}
:host .control${interactivitySelector}:hover {
background: transparent;
color: ${accentForegroundHover};
text-decoration: none;
}
:host .control${interactivitySelector}:active {
background: transparent;
color: ${accentForegroundActive};
text-decoration: none;
}
:host .control:${focusVisible} {
box-shadow: 0 0 0 calc(${focusStrokeWidth} * 1px) ${focusStrokeOuter} !important;
}
:host .control${nonInteractivitySelector} {
background: transparent;
}
`.withBehaviors(
forcedColorsStylesheetBehavior(
css`
Expand Down Expand Up @@ -356,6 +365,10 @@ export const LightweightButtonStyles = (
background: ${neutralFillStealthActive};
color: ${accentForegroundActive};
}
:host .control${nonInteractivitySelector} {
background: ${neutralFillStealthRest};
}
`.withBehaviors(
forcedColorsStylesheetBehavior(
css`
Expand Down Expand Up @@ -402,6 +415,11 @@ export const OutlineButtonStyles = (
:host .control${interactivitySelector}:active {
border-color: ${neutralStrokeActive};
}
:host .control${nonInteractivitySelector} {
background: transparent !important;
border-color: ${neutralStrokeRest};
}
`.withBehaviors(
forcedColorsStylesheetBehavior(
css`
Expand Down Expand Up @@ -436,6 +454,10 @@ export const StealthButtonStyles = (
:host .control${interactivitySelector}:active {
background: ${neutralFillStealthActive};
}
:host .control${nonInteractivitySelector} {
background: ${neutralFillStealthRest};
}
`.withBehaviors(
forcedColorsStylesheetBehavior(
css`
Expand Down
22 changes: 12 additions & 10 deletions packages/web-components/src/tooltip/tooltip.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
controlCornerRadius,
fillColor,
neutralForegroundRest,
neutralStrokeLayerRest,
strokeWidth,
typeRampBaseFontSize,
typeRampBaseLineHeight,
Expand All @@ -32,7 +33,7 @@ export const tooltipStyles: (
.tooltip {
box-sizing: border-box;
border-radius: calc(${controlCornerRadius} * 1px);
border: calc(${strokeWidth} * 1px) solid transparent;
border: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
background: ${fillColor};
color: ${neutralForegroundRest};
padding: 4px 12px;
Expand Down Expand Up @@ -66,13 +67,14 @@ export const tooltipStyles: (
width: 12px;
height: 12px;
background: ${fillColor};
border-radius: calc(${controlCornerRadius} * 1px);
border-top: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
border-left: calc(${strokeWidth} * 1px) solid ${neutralStrokeLayerRest};
position: absolute;
}
fluent-anchored-region.top .tooltip::after {
transform: rotate(45deg) translateX(-50%);
bottom: 4px;
transform: translateX(-50%) rotate(225deg);
bottom: 5px;
left: 50%;
}
Expand All @@ -81,8 +83,8 @@ export const tooltipStyles: (
}
fluent-anchored-region.bottom .tooltip::after {
transform: rotate(45deg) translateX(-50%);
top: 12px;
transform: translateX(-50%) rotate(45deg);
top: 5px;
left: 50%;
}
Expand All @@ -91,19 +93,19 @@ export const tooltipStyles: (
}
fluent-anchored-region.left .tooltip::after {
transform: rotate(45deg) translateY(-50%);
transform: translateY(-50%) rotate(135deg);
top: 50%;
right: 12px;
right: 5px;
}
fluent-anchored-region.left .tooltip {
margin-right: 12px;
}
fluent-anchored-region.right .tooltip::after {
transform: rotate(45deg) translateY(-50%);
transform: translateY(-50%) rotate(-45deg);
top: 50%;
left: 4px;
left: 5px;
}
fluent-anchored-region.right .tooltip {
Expand Down

0 comments on commit 6db3fc1

Please sign in to comment.