css-lightbox 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.mkdn +81 -0
- data/lib/css-lightbox.rb +1 -0
- data/stylesheets/_css-lightbox.scss +27 -0
- data/stylesheets/css-lightbox/_lightbox.scss +36 -0
- data/templates/project/_lightbox.scss +31 -0
- data/templates/project/lightbox.html +18 -0
- data/templates/project/manifest.rb +16 -0
- metadata +82 -0
data/README.mkdn
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
Compass CSS Lightbox
|
2
|
+
====================
|
3
|
+
|
4
|
+
CSS-only lightboxes that work in Everything But IE. Degrades gracefully, with
|
5
|
+
no effect on IE at all, so you can set fallback styles there and/or bootstrap it
|
6
|
+
with Javascript.
|
7
|
+
|
8
|
+
Installation
|
9
|
+
============
|
10
|
+
|
11
|
+
From the command line:
|
12
|
+
|
13
|
+
sudo gem install css-lightbox
|
14
|
+
|
15
|
+
Add to a project (rails: compass.config, other: config.rb):
|
16
|
+
|
17
|
+
require 'css-lightbox'
|
18
|
+
|
19
|
+
Or create a new project:
|
20
|
+
|
21
|
+
compass -r css-lightbox -f css-lightbox project_directory
|
22
|
+
|
23
|
+
|
24
|
+
Lightboxes
|
25
|
+
==========
|
26
|
+
|
27
|
+
Your HTML:
|
28
|
+
|
29
|
+
<div id="content">
|
30
|
+
<!-- all your normal page content, with links to lightboxes: -->
|
31
|
+
<a href="#about-us">a link to the about-us lightbox</a>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div id="lightboxes">
|
35
|
+
|
36
|
+
<!-- start lightbox -->
|
37
|
+
<aside id="about-us">
|
38
|
+
<div>
|
39
|
+
<!-- Your Lightbox Content -->
|
40
|
+
<a href="#" title="close the about lightbox">close</a>
|
41
|
+
</div>
|
42
|
+
</aside>
|
43
|
+
<!-- end lightbox... repeat as needed... -->
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
The important part is that you have:
|
48
|
+
|
49
|
+
* elements with an ID linked from the content (the `aside` above)
|
50
|
+
* an inner element in each that will act as the box itself (the `div` above)
|
51
|
+
* a link to `#` from each box, to close it
|
52
|
+
|
53
|
+
Your Scss:
|
54
|
+
|
55
|
+
// override these if you want
|
56
|
+
//
|
57
|
+
// // set to "true" for CSS3 transform fade-in/out
|
58
|
+
// // - bug in Chrome allows you to see fade-out on-load
|
59
|
+
// !lightbox-fade ||= "false"
|
60
|
+
//
|
61
|
+
// // set to your box element
|
62
|
+
// // or false to set the box styles on your own (see below)
|
63
|
+
// !lightbox-box ||= "> div"
|
64
|
+
|
65
|
+
// import lightboxes
|
66
|
+
@import "css-lightbox";
|
67
|
+
|
68
|
+
// make it happen (assuming lightbox.html markup)
|
69
|
+
#lightboxes aside {
|
70
|
+
@include css-lightbox;
|
71
|
+
|
72
|
+
// add styles for IE
|
73
|
+
// properties: values
|
74
|
+
|
75
|
+
// override box styles
|
76
|
+
// &:not(:target), &:target
|
77
|
+
// > div
|
78
|
+
// properties: values
|
79
|
+
|
80
|
+
}
|
81
|
+
|
data/lib/css-lightbox.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Compass::Frameworks.register("css-lightbox", :path => "#{File.dirname(__FILE__)}/..")
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// CSS-only Lightboxes
|
2
|
+
// Plugin by Eric Meyer - http://www.oddbird.net/
|
3
|
+
// Based on the work of Jenna Smith - http://growldesign.co.uk/
|
4
|
+
|
5
|
+
// CSS-only lightboxes that work in Everything But IE. Degrades gracefully, with
|
6
|
+
// no effect on IE at all, so you can set fallback styles there or bootstrap it
|
7
|
+
// with Javascript. Probably both.
|
8
|
+
|
9
|
+
// Set this to "true" to turn on CSS transitions
|
10
|
+
// - causes Chrome to show fade-out on-load
|
11
|
+
$lightbox-fade: false !default;
|
12
|
+
|
13
|
+
// override to set your own box styles as follows:
|
14
|
+
// FOR EXAMPLE:
|
15
|
+
//
|
16
|
+
// #lightboxes aside
|
17
|
+
// +css-lightbox
|
18
|
+
//
|
19
|
+
// &:not(:target), &:target
|
20
|
+
// > div
|
21
|
+
// /* styles for your box element
|
22
|
+
|
23
|
+
//
|
24
|
+
$lightbox-box: "> div" !default;
|
25
|
+
|
26
|
+
// import lightboxes
|
27
|
+
@import "css-lightbox/lightbox";
|
@@ -0,0 +1,36 @@
|
|
1
|
+
// apply this to the container elements of each lightbox
|
2
|
+
@mixin css-lightbox($fade: $lightbox-fade, $style: $lightbox-box) {
|
3
|
+
&:not(:target), &:target {
|
4
|
+
@include reset-box-model;
|
5
|
+
@include reset-font;
|
6
|
+
display: block;
|
7
|
+
z-index: -1;
|
8
|
+
position: fixed;
|
9
|
+
top: 0;
|
10
|
+
left: 0;
|
11
|
+
width: 100%;
|
12
|
+
@include transparent;
|
13
|
+
@if $fade {
|
14
|
+
@include transition(unquote("opacity, z-index"));
|
15
|
+
}
|
16
|
+
@if $style {
|
17
|
+
#{$style} {
|
18
|
+
margin: 3em auto;
|
19
|
+
padding: 1.5em;
|
20
|
+
width: 32em;
|
21
|
+
border: 1em solid;
|
22
|
+
background: white;
|
23
|
+
text-align: left;
|
24
|
+
@include box-shadow(rgba(0, 0, 0, 0.9), 0, 0, 1em);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
&:target {
|
30
|
+
z-index: 999;
|
31
|
+
@include opaque;
|
32
|
+
@if $fade {
|
33
|
+
@include transition(unquote("opacity, z-index"));
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
// CSS LIGHTBOXES
|
2
|
+
// CSS-only lightboxes that work in Everything But IE. Degrades gracefully, with
|
3
|
+
// no effect on IE at all, so you can set fallback styles there or bootstrap it
|
4
|
+
// with Javascript. Probably both.
|
5
|
+
|
6
|
+
// override these if you want
|
7
|
+
//
|
8
|
+
// // set to "true" for CSS3 transform fade-in/out
|
9
|
+
// // - bug in Chrome allows you to see fade-out on-load
|
10
|
+
// !lightbox-fade ||= "false"
|
11
|
+
//
|
12
|
+
// // set to your box element
|
13
|
+
// // or false to set the box styles on your own (see below)
|
14
|
+
// !lightbox-box ||= "> div"
|
15
|
+
|
16
|
+
// import lightboxes
|
17
|
+
@import "css-lightbox";
|
18
|
+
|
19
|
+
// make it happen (assuming lightbox.html markup)
|
20
|
+
#lightboxes aside {
|
21
|
+
@include css-lightbox;
|
22
|
+
|
23
|
+
// add styles for IE
|
24
|
+
// properties: values
|
25
|
+
|
26
|
+
// override box styles
|
27
|
+
// &:not(:target), &:target
|
28
|
+
// > div
|
29
|
+
// properties: values
|
30
|
+
|
31
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div id="content">
|
2
|
+
<!-- all your normal page content, with links to lightboxes: -->
|
3
|
+
<a href="#about-us">a link to the about-us lightbox</a>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div id="lightboxes">
|
7
|
+
|
8
|
+
<!-- start lightbox -->
|
9
|
+
<!-- You need this structure, but can use whatever tags/classes/IDs you like-->
|
10
|
+
<aside id="about-us">
|
11
|
+
<div>
|
12
|
+
<!-- Your Lightbox Content -->
|
13
|
+
<a href="#" title="close the about lightbox">close</a>
|
14
|
+
</div>
|
15
|
+
</aside>
|
16
|
+
<!-- end lightbox... repeat as needed... -->
|
17
|
+
|
18
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Make sure you list all the project template files here in the manifest.
|
2
|
+
stylesheet '_lightbox.scss', :media => 'screen, projection'
|
3
|
+
html 'lightbox.html'
|
4
|
+
|
5
|
+
description "css-only lightboxes"
|
6
|
+
|
7
|
+
help %Q{
|
8
|
+
Installs some html and a stylesheet that you can use directly
|
9
|
+
or refer to as an example.
|
10
|
+
}
|
11
|
+
|
12
|
+
welcome_message %Q{
|
13
|
+
Please refer to the lightbox.html file to see how the markup should be structured.
|
14
|
+
And to the lightbox stylesheet partial to see how to use the library and apply it to your markup.
|
15
|
+
}
|
16
|
+
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: css-lightbox
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Eric Meyer
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-04-20 00:00:00 -06:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: compass
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 10
|
30
|
+
- 0
|
31
|
+
- rc3
|
32
|
+
version: 0.10.0.rc3
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: a css-only lightbox implementation for compass
|
36
|
+
email: eric@oddbird.net
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- README.mkdn
|
45
|
+
- lib/css-lightbox.rb
|
46
|
+
- stylesheets/_css-lightbox.scss
|
47
|
+
- stylesheets/css-lightbox/_lightbox.scss
|
48
|
+
- templates/project/_lightbox.scss
|
49
|
+
- templates/project/lightbox.html
|
50
|
+
- templates/project/manifest.rb
|
51
|
+
has_rdoc: true
|
52
|
+
homepage: http://www.oddbird.net/
|
53
|
+
licenses: []
|
54
|
+
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
requirements: []
|
75
|
+
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.3.6
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: a css-only lightbox implementation for compass
|
81
|
+
test_files: []
|
82
|
+
|