Coder Social home page Coder Social logo

button's Introduction

Looking for SASS-based d2l-button? It's over here.

d2l-button

Bower version Build status

A series of Polymer-based web components for D2L buttons.

screenshot of button component

For further information on this and other D2L UI components, see the docs at ui.valence.d2l.com.

Installation

d2l-button can be installed from Bower:

bower install d2l-button

Usage

Include the webcomponents.js "lite" polyfill (for browsers who don't natively support web components), then import d2l-button.html:

Button

<head>
	<script src="https://s.brightspace.com/lib/webcomponentsjs/0.7.21/webcomponents-lite.min.js"></script>
	<link rel="import" href="../d2l-button/d2l-button.html">
</head>

The native <button> element can now be extended to be a d2l-button:

<button is="d2l-button">Button Element</button>

Buttons can be made primary:

<button is="d2l-button" primary>Primary Button</button>

And can be disabled:

<button is="d2l-button" disabled>Disabled Button</button>

Floating Workflow Buttons

Floating workflow buttons behavior can be added by using the <d2l-floating-buttons> custom element. When the normal position of the workflow buttons is below the bottom edge of the view-port, they'll dock at the bottom edge. When the normal position becomes visible, they'll undock.

<head>
	<script src="https://s.brightspace.com/lib/webcomponentsjs/0.7.21/webcomponents-lite.min.js"></script>
	<link rel="import" href="../d2l-button/d2l-button.html">
	<link rel="import" href="../d2l-button/d2l-floating-buttons.html">
</head>

Include the <d2l-floating-buttons> container at the bottom of the page, and add your workflow button elements:

<body>
	...
	<d2l-floating-buttons>
		<button is="d2l-button" primary>Save</button>
		<button is="d2l-button">Cancel</button>
	</d2l-floating-buttons>
</body>

Usage in Production

In production, it's recommended to use a build tool like Vulcanize to combine all your web components into a single import file. More from the Polymer Docs: Optimize for Production...

Coding styles

See the Best Practices & Style Guide for information on naming conventions, plus information about the EditorConfig rules used in this repo.

button's People

Contributors

awikkerink avatar capajon avatar dbatiste avatar dlockhart avatar ihabalkabary avatar j3parker avatar njostonehouse avatar omsmith avatar ryantmer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.