diff --git a/packages/css/src/button/button.css b/packages/css/src/button/button.css index 31c52c4b..0542440c 100644 --- a/packages/css/src/button/button.css +++ b/packages/css/src/button/button.css @@ -103,6 +103,52 @@ color: var(--mdPrimaryColor); } +.md-button--secondary:disabled > .md-button__rightIcon { + color: var(--mdGreyColor20); +} + +.md-button--tertiary { + background-color: transparent; + border: none; + border-radius: 0.43rem; + color: var(--mdPrimaryColor); + padding: calc(0.75rem - 2px) calc(1.5rem - 2px); +} + +.md-button--small.md-button--tertiary { + padding: calc(0.4rem - 2px) calc(0.8rem - 2px); +} + +.md-button--tertiary:hover:enabled { + text-decoration: underline; + background-color: var(--mdPrimaryColor20); +} + +.md-button--tertiary:focus:enabled { + border-color: var(--mdPrimaryColor); + outline: 2px var(--mdPrimaryColor80) solid; + background-color: transparent; + outline-offset: 0px; +} + +.md-button--tertiary:focus:hover:enabled { + background-color: var(--mdPrimaryColor20); +} + +.md-button--tertiary:disabled { + background-color: transparent; + color: var(--mdGreyColor20); + border-color: var(--mdGreyColor20); +} + +.md-button--tertiary > .md-button__rightIcon { + color: var(--mdPrimaryColor); +} + +.md-button--tertiary:disabled > .md-button__rightIcon { + color: var(--mdGreyColor20); +} + .md-button--danger { background-color: var(--mdErrorColor); } diff --git a/packages/react/src/button/MdButton.tsx b/packages/react/src/button/MdButton.tsx index 19305895..a0842af1 100644 --- a/packages/react/src/button/MdButton.tsx +++ b/packages/react/src/button/MdButton.tsx @@ -26,6 +26,7 @@ const MdButton: React.FunctionComponent = ({ { 'md-button--small': !!small, 'md-button--secondary': theme === 'secondary', + 'md-button--tertiary': theme === 'tertiary', 'md-button--danger': theme === 'danger', 'md-button--column': !!topIcon, }, diff --git a/stories/Button.stories.tsx b/stories/Button.stories.tsx index 11153d88..c552a9e5 100644 --- a/stories/Button.stories.tsx +++ b/stories/Button.stories.tsx @@ -50,7 +50,7 @@ export default { summary: 'text', }, }, - options: ['primary', 'secondary', 'danger'], + options: ['primary', 'secondary', 'danger', 'tertiary'], control: { type: 'inline-radio' }, if: { arg: 'theme', exists: true }, }, @@ -157,6 +157,14 @@ Secondary.args = { small: false, }; +export const Tertiary = Template.bind({}); +Tertiary.args = { + theme: 'tertiary', + label: 'TertiƦrknapp', + disabled: false, + small: false, +}; + export const Error = Template.bind({}); Error.args = { theme: 'danger',