├── README.md ├── LICENSE.txt └── keys.css /README.md: -------------------------------------------------------------------------------- 1 | # KEYS.css 2 | 3 | A simple stylesheet to render beautiful keyboard-styled elements. 4 | 5 | ## Usage 6 | 7 | Download the stylesheet and include it via 8 | 9 | 10 | 11 | The stylesheet comes with two classes for light and dark keys for good visibility on every background. Since most websites have light backgrounds, the dark style is the default. 12 | 13 | 14 | ctrl + S 15 | 16 | ctrl + S 17 | 18 | 19 | ctrl + S 20 | 21 | 22 | 23 | ctrl + S 24 | 25 | 26 | ctrl + S 27 | 28 | 29 | That's all. The size of the keys depends on the set `font-size`. 30 | 31 | ## License 32 | 33 | MIT License (see LICENSE.txt) 34 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Michael Hüneburg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /keys.css: -------------------------------------------------------------------------------- 1 | /** 2 | * KEYS.css 3 | * 4 | * A simple stylesheet for rendering beautiful keyboard-style elements. 5 | * 6 | * Author: Michael Hüneburg 7 | * Website: http://michaelhue.com/keyscss 8 | * License: MIT License (see LICENSE.txt) 9 | */ 10 | 11 | /* Base style, essential for every key. */ 12 | kbd, .key { 13 | display: inline; 14 | display: inline-block; 15 | min-width: 1em; 16 | padding: .2em .3em; 17 | font: normal .85em/1 "Lucida Grande", Lucida, Arial, sans-serif; 18 | text-align: center; 19 | text-decoration: none; 20 | -moz-border-radius: .3em; 21 | -webkit-border-radius: .3em; 22 | border-radius: .3em; 23 | border: none; 24 | cursor: default; 25 | -moz-user-select: none; 26 | -webkit-user-select: none; 27 | user-select: none; 28 | } 29 | kbd[title], .key[title] { 30 | cursor: help; 31 | } 32 | 33 | /* Dark style for display on light background. This is the default style. */ 34 | kbd, kbd.dark, .dark-keys kbd, .key, .key.dark, .dark-keys .key { 35 | background: rgb(80, 80, 80); 36 | background: -moz-linear-gradient(top, rgb(60, 60, 60), rgb(80, 80, 80)); 37 | background: -webkit-gradient(linear, left top, left bottom, from(rgb(60, 60, 60)), to(rgb(80, 80, 80))); 38 | color: rgb(250, 250, 250); 39 | text-shadow: -1px -1px 0 rgb(70, 70, 70); 40 | -moz-box-shadow: inset 0 0 1px rgb(150, 150, 150), inset 0 -.05em .4em rgb(80, 80, 80), 0 .1em 0 rgb(30, 30, 30), 0 .1em .1em rgba(0, 0, 0, .3); 41 | -webkit-box-shadow: inset 0 0 1px rgb(150, 150, 150), inset 0 -.05em .4em rgb(80, 80, 80), 0 .1em 0 rgb(30, 30, 30), 0 .1em .1em rgba(0, 0, 0, .3); 42 | box-shadow: inset 0 0 1px rgb(150, 150, 150), inset 0 -.05em .4em rgb(80, 80, 80), 0 .1em 0 rgb(30, 30, 30), 0 .1em .1em rgba(0, 0, 0, .3); 43 | } 44 | 45 | /* Light style for display on dark background. */ 46 | kbd.light, .light-keys kbd, .key.light, .light-keys .key { 47 | background: rgb(250, 250, 250); 48 | background: -moz-linear-gradient(top, rgb(210, 210, 210), rgb(255, 255, 255)); 49 | background: -webkit-gradient(linear, left top, left bottom, from(rgb(210, 210, 210)), to(rgb(255, 255, 255))); 50 | color: rgb(50, 50, 50); 51 | text-shadow: 0 0 2px rgb(255, 255, 255); 52 | -moz-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9); 53 | -webkit-box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9); 54 | box-shadow: inset 0 0 1px rgb(255, 255, 255), inset 0 0 .4em rgb(200, 200, 200), 0 .1em 0 rgb(130, 130, 130), 0 .11em 0 rgba(0, 0, 0, .4), 0 .1em .11em rgba(0, 0, 0, .9); 55 | } --------------------------------------------------------------------------------