From a998290b43ff45850fa4e074e63ca58f654e912a Mon Sep 17 00:00:00 2001 From: michenriksen Date: Tue, 9 Nov 2010 12:59:42 +0100 Subject: [PATCH] initial commit --- LICENSE.txt | 24 ++ README.md | 118 ++++++++++ demo.html | 363 +++++++++++++++++++++++++++++ images/css3buttons_backgrounds.png | Bin 0 -> 1367 bytes images/css3buttons_icons.png | Bin 0 -> 3352 bytes stylesheets/css3buttons.css | 61 +++++ stylesheets/demo.css | 30 +++ stylesheets/reset.css | 67 ++++++ 8 files changed, 663 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 demo.html create mode 100644 images/css3buttons_backgrounds.png create mode 100644 images/css3buttons_icons.png create mode 100644 stylesheets/css3buttons.css create mode 100644 stylesheets/demo.css create mode 100644 stylesheets/reset.css diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..00d2e13 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..39c1b0b --- /dev/null +++ b/README.md @@ -0,0 +1,118 @@ +# CSS3 Buttons # + +## What is this? ## + +[CSS3 buttons](http://css3buttons.michaelhenriksen.dk) is a simple *framework* to create good-looking GitHub style button links. + +## Buttons ## + +To create a button, the only thing you have to do is this: + + This is a Button + +If you prefer a pill-like button with more rounded corners, you can add a `.pill` class to the button + + This is a Pill Button + +Sometimes when you have multiple buttons, it's a good thing to highlight the button with the primary action +in order to give the user a visual clue of what action to take if in doubt. This can be accomplished by adding +a `.primary` class to the button + + Publish Post or Save as Draft + +## Buttons with negative actions ## + +If you have a button that triggers a negative action, like deleting data, it's good practice to warn the user +by styling the button differently than the normal buttons. Give a button the class `.negative` and the +hover-state will change from blue to red + + Divide by Zero + +## Grouped buttons ## + +You can create grouped buttons that are linked together, like seen at Gmail and other places, +by using the `.left`, `.middle` and `.right` classes: + + Archive + Report Spam + Delete + +You can also add the pill class to grouped buttons if preferred: + + Archive + Report Spam + Delete + +## Buttons with icons ## + +CSS3 Buttons supports a wide range of icons that can easily be added to any button by adding a span tag inside the anchor +tag with the class of `.icon` and any one of the provided icon classes: + + Search + +Here is a list of all the supported icon classes: + + * `.calendar` + * `.chat` + * `.check` + * `.cog` + * `.comment` + * `.cross` + * `.heart` + * `.home` + * `.key` + * `.loop` + * `.magnifier` + * `.mail` + * `.pen` + * `.plus` + * `.reload` + * `.rss` + * `.tag` + * `.trash` + * `.user` + +## Big buttons ## + +If you wish to emphasize a specific action you can add the `.big` class to make a more prominent *call-to-action* button: + + Create Project + +## Browser compatibility ## + +CSS3 Buttons works in all major browsers + +**Note:** Some CSS3 features used in CSS3 Buttons is not supported in Internet Explorer browsers! + +## Installation ## + + 1. Drop `css3buttons.css` in your stylesheets folder + 2. Drop `css3buttons_backgrounds.png` and `css3buttons_icons.png` in your images folder + 3. Link to `css3buttons.css` in the head section of your HTML page + +## License ## + +### The [Unlicense](http://unlicense.org): ### + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to + +## Shout-Outs ## + + * Thanks to [GitHub](http://github.com) and [David Walsh](http://davidwalsh.name/github-css) for inspiration! + * Icons used in CSS3 Buttons are from the excellent [Iconic pack](http://somerandomdude.com/projects/iconic/) by [some random dude](http://somerandomdude.com/)! + +## Contact ## + +### Found a Bug? ### +Please create a [ticket on GitHub](https://github.com/michenriksen/css3buttons/issues) With a description of the problem, browser and operating system information and how to reproduce the problem. + +### Need Help? ### +You can send me a private message on [GitHub](http://github.com/michenriksen/) and I'll do my best to help you. \ No newline at end of file diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..2ce9eac --- /dev/null +++ b/demo.html @@ -0,0 +1,363 @@ + + + + + CSS3 Buttons | Simple CSS3 framework for creating button links + + + + + + + +
+
+

CSS3 Buttons

+
+ +
+
+

What is this?

+ +

+ CSS3 buttons is a simple framework + to create good-looking GitHub style button links. +

+
+ +
+

Buttons

+ +

To create a button, the only thing you have to do is this:

+ +
+

Code:

+
<a href="#" class="button">This is a Button</a>
+					
+ +

Result:

+ +
+ +

If you prefer a pill-like button with more rounded corners, you can add a .pill class to the button

+ +
+

Code:

+
<a href="#" class="pill button">This is a Pill Button</a>
+					
+ +

Result:

+ +
+ +

+ Sometimes when you have multiple buttons, it's considered good practice to highlight the button with the primary action in order to give + the user a visual clue of what action to take if in doubt. This can be accomplished by adding a .primary class + to the button +

+ +
+

Code:

+
<a href="#" class="primary button">Publish Post</a> or <a href="#" class="button">Save as Draft</a>
+					
+ +

Result:

+ +
+
+ +
+

Buttons with negative actions

+ +

+ If you have a button that triggers a negative action, like deleting data, it's good practice to warn the user by + styling the button differently than the normal buttons. Give a button the class .negative and the hover-state + will change from blue to red +

+ +
+

Code:

+
<a href="#" class="negative button">Divide by Zero</a>
+					
+ +

Result:

+ +
+ +
+ +
+

Grouped buttons

+ +

+ You can create grouped buttons that are linked together, like seen at Gmail and other places, by using the .left, .middle and .right classes: +

+ +
+

Code:

+
<a href="#" class="left primary button">Archive</a>
+<a href="#" class="middle button">Report Spam</a>
+<a href="#" class="right negative button">Delete</a>
+
+ +

Result:

+ ArchiveReport SpamDelete +
+ +

+ You can also add the pill class to grouped buttons if preferred: +

+ +
+

Code:

+
<a href="#" class="left primary pill button">Archive</a>
+<a href="#" class="middle pill button">Report Spam</a>
+<a href="#" class="right negative pill button">Delete</a>
+
+ +

Result:

+ ArchiveReport SpamDelete +
+
+ +
+

Buttons with icons

+ +

+ CSS3 Buttons supports a wide range of icons that can easily be added to any button by adding a span tag inside the anchor tag + with the class of .icon and any one of the provided icon classes: +

+ +
+

Code:

+
<a href="#" class="button"><span class="magnifier icon"></span>Search</a>
+					
+ +

Result:

+ Search +
+ +

Here is a list of all the supported icon classes:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassExample
.calendarAdd to Calendar
.chatStart Chat
.checkApprove Registration
.cogSettings
.commentAdd Comment
.crossRemove Item
.heartAdd to Favorites
.homeBack to Frontpage
.keyPassword Protect
.loopResend Message
.magnifierSearch
.mailSend Newsletter
.penEdit Post
.plusAdd Post
.reloadReload Page
.rssSubscribe to RSS Feed
.tagAdd Tag
.trashDelete Post
.userAdd New User
+
+
+ +
+

Big buttons

+ +

+ If you wish to emphasize a specific action you can add the .big class to make a more prominent call-to-action + button: +

+ +
+

Code:

+
<a href="#" class="big button">Create Project</a>
+					
+ +

Result:

+ Create Project +
+ +
+ +
+

Browser compatibility

+ +

+ CSS3 Buttons works in all major browsers +

+ +

+ Note: Some CSS3 features used in CSS3 Buttons is not supported in Internet Explorer browsers! +

+
+ +
+

Installation

+ +
    +
  1. Drop css3buttons.css in your stylesheets folder
  2. +
  3. Drop css3buttons_backgrounds.png and css3buttons_icons.png in your images folder
  4. +
  5. Link to css3buttons.css in the head section of your HTML page (see code example below)
  6. +
+ +
+

Code:

+
<link rel="stylesheet" href="stylesheets/css3buttons.css" media="screen">
+					
+
+ +

+ CSS3 Buttons expects that some kind of CSS reset is in place in your project, otherwise the look might not be, as seen here +

+
+ +
+

License

+ +

The Unlicense:

+ +
+

+ This is free and unencumbered software released into the public domain. +

+ +

+ Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. +

+ +

+ In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. +

+ +

+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +

+ +

+ For more information, please refer to <http://unlicense.org/> +

+
+
+ +
+

Shout-Outs

+ + +
+ +
+

Contact

+ +

Found a Bug?

+

+ Please create a ticket on GitHub With a description of the problem, browser and operating system information and how to reproduce the problem. +

+ +

Need Help?

+

+ You can send me a private message on GitHub and I'll do my best to help you. +

+
+
+ + +
+ + Fork me on GitHub + + \ No newline at end of file diff --git a/images/css3buttons_backgrounds.png b/images/css3buttons_backgrounds.png new file mode 100644 index 0000000000000000000000000000000000000000..7e440cd716b2fd0d07af5571bece6d2afd472cfc GIT binary patch literal 1367 zcmah}Ye^84%m5X5;uE3CAVF z2N9nKtOSqrVt}o#u!ao`Oz-VzRsdAU5?8-h#`yueUg8f`IEZS-7|`VfI;%CEN6Z_3 zu0odpbaDWNS1qDMJRHmR_`Dr_xU)E#1e!2pWLmb^BVoa2Gvpw~q=lIH5>?Y&xBxWz z*NxjilaK~55RCa{c$#P~_2t3DZG3y|vng}6D0jCI z#My|y@GRD~poA$rDlUvizOzl(O8?gbApmZ<@asRjSh~Jq>##>J)O}ldzEYVP3KJ%WOaAZiLYPi4 zm)4>fuRcZbwC|HcBh!0^Ks1645RQAC`E<1zD|`h zFyKz-!VckBG`%ANfd4hHIG)TINi`%wGYq>1VIcU+emL6- zTzGg99Sh=fEZp~?2wT-rD4B}e&}az2lSkI#HsltX0deL+Ponc_lh_f136mFE?NR|u zwfG>yItDV??GKt8K|5?&x=5ocBaK?T5(b^3mmefflDk;meW59+wLs`>!Al&@=hUAU z3i;M!d2aw3W)G^X{X%yu2?zPNOG=N0t3t6%CX?Q0p@bXT%sUqP%f<@03+t}umec*L zm^iQZshUyRPDlMJ*1#d<+6Ra;G_x8&T>fZ>;2#P=Tq6iDN({G_ajy7NX5^-~D^Az` E2JT=&k^lez literal 0 HcmV?d00001 diff --git a/images/css3buttons_icons.png b/images/css3buttons_icons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"" ""; } + +/* Remove annoying border on linked images. */ +a img { border: none; } + +/* Remember to define your own focus styles! */ +:focus { outline: 0; } \ No newline at end of file