2.0.0 • Published 5 years ago

@gfsdeliver/gfs-button v2.0.0

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
5 years ago

GFS Button

Buttons have 3 attributes you can use: text, outlined and raised. Read below how you can use them and what does each one.

Install

$ npm i --save gfs-button

Import In a HTML file:

<html>
    <head>
        <script type="module">
            import '@gfsdeliver/gfs-button/gfs-button.js';
        </script>
    </head>
    <body>
        <h3>Text buttons</h3>
            <gfs-button text class="default">Default</gfs-button>
            <gfs-button text class="primary">Primary</gfs-button>
            <gfs-button text class="secondary">Secondary</gfs-button>
            <gfs-button text disabled>Disabled</gfs-button>

        <h3>Outlined buttons</h3>
            <gfs-button outlined class="default outlined">Default</gfs-button>
            <gfs-button outlined class="primary outlined">Primary</gfs-button>
            <gfs-button outlined class="secondary outlined">Secondary</gfs-button>
            <gfs-button outlined disabled class="disabled outlined">Disabled</gfs-button>

        <h3>Contained buttons</h3>
            <gfs-button raised class="default">Default</gfs-button>
            <gfs-button raised class="primary">Primary</gfs-button>
            <gfs-button raised class="secondary">Secondary</gfs-button>
            <gfs-button raised disabled>Disabled</gfs-button>
    </body>
</html>

In a Polymer 3 element

import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
import '@gfsdeliver/gfs-button/gfs-button.js';

class CustomElement extends PolymerElement {
    static get template() {
        return html`
            <h3>Text buttons</h3>
                <gfs-button text class="default">Default</gfs-button>
                <gfs-button text class="primary">Primary</gfs-button>
                <gfs-button text class="secondary">Secondary</gfs-button>
                <gfs-button text disabled>Disabled</gfs-button>

            <h3>Outlined buttons</h3>
                <gfs-button outlined class="default outlined">Default</gfs-button>
                <gfs-button outlined class="primary outlined">Primary</gfs-button>
                <gfs-button outlined class="secondary outlined">Secondary</gfs-button>
                <gfs-button outlined disabled class="disabled outlined">Disabled</gfs-button>

            <h3>Contained buttons</h3>
                <gfs-button raised class="default">Default</gfs-button>
                <gfs-button raised class="primary">Primary</gfs-button>
                <gfs-button raised class="secondary">Secondary</gfs-button>
                <gfs-button raised disabled>Disabled</gfs-button>
        `;
    }
}
customElements.define('custom-element', CustomElement);

Attribute

PropertyDescription
texttext button only
outlinedbutton with a border and no background color filled
raisedadds a shadow to the button, not suitable for text buttons

Styling

Custom propertyDescriptionDefault
--gfs-button-colorbutton font color--white-color;
--gfs-button-bgbutton background color--gfs-main-color;
--gfs-button-font-sizebutton font size14px
--gfs-button-font-familybutton font family"Segoe UI", 'Helvetica Neue'
--gfs-button-font-weightbutton font weightnormal
--gfs-button-text-transformbutton text transformnormal
--gfs-button-border-radiusborder radius of the button3px
--gfs-iron-icon-widthwidth of the icon18px;
--gfs-iron-icon-heightheight of the icon18px;
--gfs-iron-icon-fillfill color of the svg iconcurrentcolor;
--gfs-iron-icon-strokestroke color of the svg iconnone;
--gfs-button-text-transformnormal
--gfs-text-default-hover-backgroundtext button only default background on hoverrgba(149, 145, 145, .23)
--gfs-text-primary-hover-backgroundtext button only primary background on hoverrgba(214, 0, 0, .10)
--gfs-text-secondary-hover-backgroundtext button only secondary background on hoverrgba(51, 117, 224, .25)
--gfs-text-disabled-hover-backgroundtext button only disabled background on hoverrgba(168, 168, 168, .3)
--gfs-outline-default-borderoutline style border style for default button1px solid rgba(149, 145, 145, 1)
--gfs-outline-primary-borderoutline style border style for primary button1px solid rgba(214, 0, 0, 1)
--gfs-outline-secondary-borderoutline style border style for secondary button1px solid rgba(51, 117, 224, 1)
--gfs-outline-disabled-borderoutline style border style for disabled button1px solid rgba(168, 168, 168, 1)
--gfs-outline-default-hover-backgroundoutline background color on over for default buttonrgba(149, 145, 145, .23)
--gfs-outline-primary-hover-backgroundoutline background color on over for primary buttonrgba(214, 0, 0, .10)
--gfs-outline-secondary-hover-backgroundoutline background color on over for secondary buttonrgba(51, 117, 224, .25)
--gfs-outline-disabled-hover-backgroundoutline background color on over for disabled buttonrgba(168, 168, 168, .3)
--default-buttonmixin styles for default button
--primary-buttonmixin styles for primary button
--secondary-buttonmixin styles for secondary button

License

Apache License 2.0