Skip to content

Commit

Permalink
prepare project for theming
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrins committed Jul 26, 2013
1 parent 46c26fc commit 04004f5
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 14 deletions.
20 changes: 6 additions & 14 deletions spectrum.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,13 @@ License: MIT
bottom:0;
}

.sp-alpha-enabled .sp-top
{
.sp-alpha-enabled .sp-top {
margin-bottom: 18px;
}
.sp-alpha-enabled .sp-alpha
{
.sp-alpha-enabled .sp-alpha {
display: block;
}

.sp-alpha-handle
{
.sp-alpha-handle {
position:absolute;
top:-4px;
bottom: -4px;
Expand All @@ -80,17 +76,15 @@ License: MIT
background: white;
opacity: .8;
}

.sp-alpha
{
.sp-alpha {
display: none;
position: absolute;
bottom: -14px;
right: 0;
left: 0;
height: 8px;
}
.sp-alpha-inner{
.sp-alpha-inner {
border: solid 1px #333;
}

Expand Down Expand Up @@ -154,7 +148,6 @@ License: MIT
Generate 6 divs, line them up, and do two color gradients for each.
Yes, really.
*/

.sp-1 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
Expand Down Expand Up @@ -195,7 +188,6 @@ License: MIT
.sp-hue { left: 63%; }
.sp-fill { padding-top: 60%; }
}

.sp-dragger {
border-radius: 5px;
height: 5px;
Expand All @@ -219,7 +211,7 @@ License: MIT
opacity: .8;
}

/* Basic display options (colors, fonts, global widths) */
/* Basic themeable display options (colors, fonts, global widths) */
.sp-container {
border-radius: 0;
background-color: #ECECEC;
Expand Down
88 changes: 88 additions & 0 deletions themes/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Spectrum - The No Hassle jQuery Colorpicker</title>

<meta name="description" content="Spectrum is a JavaScript colorpicker plugin using the jQuery framework. It is highly customizable, but can also be used as a simple input type=color polyfill">
<meta name="author" content="Brian Grinstead and Spectrum contributors">

<link rel="stylesheet" type="text/css" href="../spectrum.css">
<link rel="stylesheet" type="text/css" href="../docs/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../docs/docs.css">
<script type="text/javascript" src="../docs/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../spectrum.js"></script>


<link rel="stylesheet" type="text/css" href="sp-dark.css">

</head>
<body>
<div id='header'>
<h1><a href='http://bgrins.github.com/spectrum'>Spectrum</a></h1> <h2><em>The No Hassle jQuery Colorpicker</em></h2>
<div id='links'>
View the <a href='http://github.com/bgrins/spectrum'>Source code</a>.
Spectrum is a project by <a href='http://twitter.com/bgrins'>@bgrins</a>.
</div>
<br style='clear:both;' />
</div>

<div class="container">
<h2>Themes</h2>

<div class="alert">
This page is in development.
</div>

<div id="theme-gallery">
<h3>Gallery of existing themes</h3>

<div class="theme" id="sp-light">
<h4>sp-light</h4>
<p>This is the default theme that you know and love.</p>

<div class='example'>
<input type='text' />
</div>
</div>

<div class="theme" id="sp-dark">
<h4>sp-dark</h4>
<p>Similar to sp-light, only ... darker</p>

<div class='example'>
<input type='text' />
</div>
</div>
</div>

<div id="theme-instructions">
<h3>Instructions for building themes</h3>
</div>
</div>


<script>
$("#sp-light input").spectrum({
theme: "sp-light"
});
$("#sp-dark input").spectrum({
theme: "sp-dark"
});
</script>
<script type="text/javascript" src="../docs/prettify.js"></script>
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8259845-4']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
</body>
</html>
24 changes: 24 additions & 0 deletions themes/sp-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Container */
.sp-dark.sp-container {
background-color: #333;
border: solid 1px #555;
}

/* Replacer (the little preview div that shows up instead of the <input>) */
.sp-dark.sp-replacer {
border: solid 1px #fff;
background: #333;
color: #eee;
vertical-align: middle;
}
.sp-replacer:hover, .sp-replacer.sp-active {
border-color: #F0C49B;
color: #fff;
}
.sp-replacer.sp-disabled {
border-color: silver;
color: silver;
}
.sp-dark .sp-preview {
border: solid 1px #eee;
}

0 comments on commit 04004f5

Please sign in to comment.