mirror of
https://github.com/pure-css/pure.git
synced 2024-12-10 23:44:26 +00:00
fix: add button icons fixes #938
This commit is contained in:
parent
a5475b4b3b
commit
8832b57b3f
@ -24,6 +24,12 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
projectName: 'pure-css.github.io',
|
projectName: 'pure-css.github.io',
|
||||||
|
scripts: [
|
||||||
|
{
|
||||||
|
src: 'https://kit.fontawesome.com/f7f35653b1.js',
|
||||||
|
defer: true,
|
||||||
|
}
|
||||||
|
],
|
||||||
themes: ['@docusaurus/theme-classic'],
|
themes: ['@docusaurus/theme-classic'],
|
||||||
customFields: {
|
customFields: {
|
||||||
PURE_DOWNLOAD_SNIPPET,
|
PURE_DOWNLOAD_SNIPPET,
|
||||||
|
@ -17,7 +17,7 @@ function Buttons() {
|
|||||||
<SectionHeader heading="Default Buttons" />
|
<SectionHeader heading="Default Buttons" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To create a Pure Button, add the <code>pure-button</code> classname to any <code><a></code> or <code><button></code> element.
|
To create a Pure Button, add the <code>pure-button</code> classname to any <code><a></code> or <code><button></code> element.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
@ -28,8 +28,8 @@ function Buttons() {
|
|||||||
<SectionHeader heading="Disabled Buttons" />
|
<SectionHeader heading="Disabled Buttons" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To mark a button as disabled, add the <code>pure-button-disabled</code> classname alongside <code>pure-button</code>.
|
To mark a button as disabled, add the <code>pure-button-disabled</code> classname alongside <code>pure-button</code>.
|
||||||
Alternatively, add the "disabled" attribute directly to your button.
|
Alternatively, add the "disabled" attribute directly to your button.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
@ -40,7 +40,7 @@ function Buttons() {
|
|||||||
<SectionHeader heading="Active Buttons" />
|
<SectionHeader heading="Active Buttons" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To style a button so that it appears "pressed", add the <code>pure-button-active</code> classname alongside <code>pure-button</code>.
|
To style a button so that it appears "pressed", add the <code>pure-button-active</code> classname alongside <code>pure-button</code>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
@ -51,7 +51,7 @@ function Buttons() {
|
|||||||
<SectionHeader heading="Primary Buttons" />
|
<SectionHeader heading="Primary Buttons" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To indicate that a button represents a primary action, add the <code>pure-button-primary</code> classname alongside <code>pure-button</code>.
|
To indicate that a button represents a primary action, add the <code>pure-button-primary</code> classname alongside <code>pure-button</code>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
@ -62,11 +62,11 @@ function Buttons() {
|
|||||||
<SectionHeader heading="Customizing Buttons" />
|
<SectionHeader heading="Customizing Buttons" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Thanks to Pure's minimal styling, it is easy to build off of the generic Pure button and create customized buttons for your own application.
|
Thanks to Pure's minimal styling, it is easy to build off of the generic Pure button and create customized buttons for your own application.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To customize button styles, you should group your custom CSS into a class such as <code>button-foo</code>, which you can then add to an element that already has the <code>pure-button</code> classname. Here are some examples.
|
To customize button styles, you should group your custom CSS into a class such as <code>button-foo</code>, which you can then add to an element that already has the <code>pure-button</code> classname. Here are some examples.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 className="content-subhead">Colored buttons with rounded corners</h3>
|
<h3 className="content-subhead">Colored buttons with rounded corners</h3>
|
||||||
@ -131,32 +131,32 @@ function Buttons() {
|
|||||||
<h3 className="content-subhead">Buttons with icons</h3>
|
<h3 className="content-subhead">Buttons with icons</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Pure doesn't ship with icon fonts, but we play nice with existing ones. Incorporating icon fonts with Pure Buttons is easy. In the example below, we're using icon fonts from <a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a>. Put the <a href="http://fortawesome.github.io/Font-Awesome/get-started/">Font Awesome CSS file</a> on your page and use an <code><i></code> element within a <code>pure-button</code> element.
|
Pure doesn't ship with icon fonts, but we play nice with existing ones. Incorporating icon fonts with Pure Buttons is easy. In the example below, we're using icon fonts from <a href="https://fontawesome.com/">Font Awesome</a>. Put the <a href="https://fontawesome.com/start">Font Awesome CSS file</a> on your page and use an <code><i></code> element within a <code>pure-button</code> element.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Example>
|
<Example>
|
||||||
<button className="pure-button">
|
<button className="pure-button">
|
||||||
<i className="fa fa-cog"></i>
|
<i className="fa fa-cog"></i>
|
||||||
Settings
|
Settings
|
||||||
</button>
|
</button>
|
||||||
<a className="pure-button" href="#">
|
<a className="pure-button" href="#">
|
||||||
<i className="fa fa-shopping-cart fa-lg"></i>
|
<i className="fa fa-shopping-cart fa-lg"></i>
|
||||||
Checkout
|
Checkout
|
||||||
</a>
|
</a>
|
||||||
</Example>
|
</Example>
|
||||||
|
|
||||||
<SectionHeader heading="Button Groups" />
|
<SectionHeader heading="Button Groups" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Group multiple buttons together on a single line.
|
Group multiple buttons together on a single line.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
<p>
|
<p>
|
||||||
For assistive technologies (i.e, screen readers) a <code>role</code> attribute should be provided to ensure that proper meaning is conveyed. Button groups should have a <code>role="group"</code>, while toolbars should have <code>role="toolbar"</code>.
|
For assistive technologies (i.e, screen readers) a <code>role</code> attribute should be provided to ensure that proper meaning is conveyed. Button groups should have a <code>role="group"</code>, while toolbars should have <code>role="toolbar"</code>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Additionally, a clear label should be provided since most assistive technologies will not announce them. The code snippet below provides an example.
|
Additionally, a clear label should be provided since most assistive technologies will not announce them. The code snippet below provides an example.
|
||||||
</p>
|
</p>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user