From e70d9077f025cb1cb168e50b87f60423be9e6a00 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 17 Apr 2015 12:40:25 -0700 Subject: move buttons from content to components --- docs/_data/nav.yml | 2 +- docs/components/buttons.md | 128 +++++++++++++++++++++++++++++++++++++++++++++ docs/content/buttons.md | 128 --------------------------------------------- 3 files changed, 129 insertions(+), 129 deletions(-) create mode 100644 docs/components/buttons.md delete mode 100644 docs/content/buttons.md (limited to 'docs') diff --git a/docs/_data/nav.yml b/docs/_data/nav.yml index 3be2479ea..06969f4cd 100644 --- a/docs/_data/nav.yml +++ b/docs/_data/nav.yml @@ -67,7 +67,6 @@ - title: Sample output - title: Tables - title: Forms - - title: Buttons - title: Components pages: @@ -83,6 +82,7 @@ - title: Misc elements - title: Jumbotron - title: Page header + - title: Buttons - title: Custom forms sections: - title: Checkboxes and radios diff --git a/docs/components/buttons.md b/docs/components/buttons.md new file mode 100644 index 000000000..cf9d8dab6 --- /dev/null +++ b/docs/components/buttons.md @@ -0,0 +1,128 @@ +--- +layout: page +title: Buttons +--- + +Buttons are used to execute actions in forms, dialogs, and more. Use any of the available button classes to quickly create a styled button. + +## Examples + +Bootstrap includes six predefined button styles, each serving its own semantic purpose. + +{% example html %} + + + + + + + + + + + + + + + + + +{% endexample %} + +{% callout warning %} +#### Conveying meaning to assistive technologies + +Using color to add meaning to a button only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text of the button), or is included through alternative means, such as additional text hidden with the `.sr-only` class. +{% endcallout %} + +## Button tags + +Use the button classes on an ``, ` + + +{% endexample %} + +{% callout warning %} +#### Links acting as buttons + +If the `` elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate `role="button"`. +{% endcallout %} + +{% callout warning %} +#### Cross-browser rendering + +As a best practice, **we highly recommend using the ` + +{% endexample %} + +{% example html %} + + +{% endexample %} + +{% example html %} + + +{% endexample %} + +Create block level buttons—those that span the full width of a parent—by adding `.btn-block`. + +{% example html %} + + +{% endexample %} + +## Active state + +Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. **There's no need to add a class to ` + +{% endexample %} + +As `` elements don't support the `disabled` attribute, you must add the `.disabled` class to fake it. + +{% example html %} +Primary link +Link +{% endexample %} + +{% callout warning %} +#### Cross-browser compatibility + +If you add the `disabled` attribute to a ` - - - - - - - - - - - - - - - -{% endexample %} - -{% callout warning %} -#### Conveying meaning to assistive technologies - -Using color to add meaning to a button only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text of the button), or is included through alternative means, such as additional text hidden with the `.sr-only` class. -{% endcallout %} - -## Button tags - -Use the button classes on an ``, ` - - -{% endexample %} - -{% callout warning %} -#### Links acting as buttons - -If the `` elements are used to act as buttons – triggering in-page functionality, rather than navigating to another document or section within the current page – they should also be given an appropriate `role="button"`. -{% endcallout %} - -{% callout warning %} -#### Cross-browser rendering - -As a best practice, **we highly recommend using the ` - -{% endexample %} - -{% example html %} - - -{% endexample %} - -{% example html %} - - -{% endexample %} - -Create block level buttons—those that span the full width of a parent—by adding `.btn-block`. - -{% example html %} - - -{% endexample %} - -## Active state - -Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. **There's no need to add a class to ` - -{% endexample %} - -As `` elements don't support the `disabled` attribute, you must add the `.disabled` class to fake it. - -{% example html %} -Primary link -Link -{% endexample %} - -{% callout warning %} -#### Cross-browser compatibility - -If you add the `disabled` attribute to a `