magrathea 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +1 -2
- data/lib/magrathea/version.rb +1 -1
- data/magrathea.gemspec +13 -10
- data/vendor/assets/javascripts/magrathea.js +5 -2
- data/vendor/assets/stylesheets/_colors.scss +4 -0
- data/vendor/assets/stylesheets/_theme-switch.scss +1 -3
- data/vendor/assets/stylesheets/_typography.scss +7 -1
- data/vendor/assets/stylesheets/magrathea.scss +1 -0
- metadata +13 -11
- data/.gitignore +0 -13
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1be538a37f89b6e665df7047a3dbc2d7ddab18f960d3e41ce2523586cd8bf1c5
|
4
|
+
data.tar.gz: c6e42736487e718977dc52f98258f771b318ce86551b8be7248594772bd82ab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd024fba65be90dcaa57769bb4f16755a170388c3bc5fec6cf5ffde54406f634bf953423030ddfaec1ef097e5e53ea3d4b4c03da79b3d39c35b48f3cfc1dde1
|
7
|
+
data.tar.gz: a7a2fec02e46f4fb68b70ca28cb6dd6431544dc7e0a345e4a8257aaa3b501cd3c59c8d7b317ce98ae1cc0a79b0a528bae600799c18572b472145a2c48a56b696
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
4
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
5
|
+
|
6
|
+
---
|
7
|
+
## 0.2.0
|
8
|
+
### Added
|
9
|
+
- Updated typography styles to aim for a first "set" of HTML element support
|
10
|
+
- Updated a lot of documentation for this project
|
11
|
+
- Added this changelog bro
|
12
|
+
|
13
|
+
---
|
14
|
+
## 0.1.0
|
15
|
+
### Added
|
16
|
+
- Went through initial gem template setup
|
17
|
+
- Added some initial JS and markup for a "theme switch" component
|
18
|
+
- Pushed to prod!
|
19
|
+
|
20
|
+
---
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ In `application.js` add:
|
|
34
34
|
//= require magrathea
|
35
35
|
```
|
36
36
|
|
37
|
-
Somewhere in
|
37
|
+
Somewhere in an app view, you'll need to add the markup for the switch code as well:
|
38
38
|
```
|
39
39
|
<div class="magrathea-switch-wrapper">
|
40
40
|
<label class="magrathea-switch" for="checkbox">
|
@@ -45,7 +45,6 @@ Somewhere in your markup, you'll need to add the switch code as well:
|
|
45
45
|
</div>
|
46
46
|
```
|
47
47
|
|
48
|
-
|
49
48
|
## Development
|
50
49
|
|
51
50
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also
|
data/lib/magrathea/version.rb
CHANGED
data/magrathea.gemspec
CHANGED
@@ -4,25 +4,28 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "magrathea"
|
5
5
|
spec.version = Magrathea::VERSION
|
6
6
|
spec.authors = ["erik yuzwa"]
|
7
|
-
spec.email = ["
|
7
|
+
spec.email = ["wazoo@hey.com"]
|
8
8
|
|
9
|
-
spec.summary = %q{
|
10
|
-
spec.description = %q{
|
9
|
+
spec.summary = %q{Get the conversation started to use a dark-light theme structure with your CSS.}
|
10
|
+
spec.description = %q{Start the conversation in your project to use a dark-light theme structure with your CSS. The aim is NOT trying to come up with a drop-in replacement for every current / legacy Rails project out there.}
|
11
11
|
spec.homepage = "https://github.com/erikyuzwa/magrathea"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
14
|
|
15
|
-
#spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
15
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/erikyuzwa/magrathea"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/erikyuzwa/magrathea/blob/main/CHANGELOG.md"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
# TODO: the following was generated but didn't work when I ran gem build
|
24
|
+
# spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
25
|
+
# `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
# end
|
27
|
+
spec.files = %w[Gemfile CHANGELOG.md CODE_OF_CONDUCT.md LICENSE.txt Rakefile README.md magrathea.gemspec lib/magrathea/version.rb lib/magrathea.rb vendor/assets/javascripts/magrathea.js vendor/assets/stylesheets/_colors.scss vendor/assets/stylesheets/_dark.scss vendor/assets/stylesheets/_light.scss vendor/assets/stylesheets/_theme-switch.scss vendor/assets/stylesheets/_typography.scss vendor/assets/stylesheets/magrathea.scss]
|
28
|
+
|
26
29
|
spec.bindir = "exe"
|
27
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
31
|
spec.require_paths = ["lib"]
|
@@ -3,6 +3,8 @@
|
|
3
3
|
// Licensed under the MIT license. See LICENSE.txt file in the project root for details.
|
4
4
|
//
|
5
5
|
|
6
|
+
// TODO: figure out how to export this for rails6 webpacker usage
|
7
|
+
// keep this simple as we can without any dependencies
|
6
8
|
(function() {
|
7
9
|
|
8
10
|
var win = this;
|
@@ -10,13 +12,14 @@
|
|
10
12
|
|
11
13
|
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
|
12
14
|
|
15
|
+
// TODO: lots more error handling around localStorage needed even in 2020
|
13
16
|
function switchTheme(e) {
|
14
17
|
if (e.target.checked) {
|
15
18
|
document.documentElement.setAttribute('data-theme', 'dark');
|
16
|
-
localStorage.setItem('theme', 'dark');
|
19
|
+
localStorage.setItem('theme', 'dark');
|
17
20
|
} else {
|
18
21
|
document.documentElement.setAttribute('data-theme', 'light');
|
19
|
-
localStorage.setItem('theme', 'light');
|
22
|
+
localStorage.setItem('theme', 'light');
|
20
23
|
}
|
21
24
|
}
|
22
25
|
|
@@ -2,6 +2,10 @@
|
|
2
2
|
// Copyright (c) Erik Yuzwa of Wazoo Media. All rights reserved.
|
3
3
|
// Licensed under the MIT license. See LICENSE.txt file in the project root for details.
|
4
4
|
//
|
5
|
+
|
6
|
+
// TODO: put in some real color palette work here, then use them as variables for variables
|
7
|
+
|
8
|
+
|
5
9
|
$light-primary-color: #302ae6;
|
6
10
|
$light-secondary-color: #536390;
|
7
11
|
$light-font-color: #424242;
|
@@ -2,9 +2,7 @@
|
|
2
2
|
// Copyright (c) Erik Yuzwa of Wazoo Media. All rights reserved.
|
3
3
|
// Licensed under the MIT license. See LICENSE.txt file in the project root for details.
|
4
4
|
//
|
5
|
-
|
6
|
-
* some simple CSS to style the dark-light theme switch
|
7
|
-
*/
|
5
|
+
// TODO: these styles need a lot of improving -- maybe even removal? Just allow for our JS to tap into a checkbox event?
|
8
6
|
|
9
7
|
.theme-switch-wrapper {
|
10
8
|
display: flex;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magrathea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- erik yuzwa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass-rails
|
@@ -24,23 +24,21 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.0'
|
27
|
-
description:
|
27
|
+
description: Start the conversation in your project to use a dark-light theme structure
|
28
|
+
with your CSS. The aim is NOT trying to come up with a drop-in replacement for every
|
29
|
+
current / legacy Rails project out there.
|
28
30
|
email:
|
29
|
-
-
|
31
|
+
- wazoo@hey.com
|
30
32
|
executables: []
|
31
33
|
extensions: []
|
32
34
|
extra_rdoc_files: []
|
33
35
|
files:
|
34
|
-
-
|
35
|
-
- ".rspec"
|
36
|
-
- ".travis.yml"
|
36
|
+
- CHANGELOG.md
|
37
37
|
- CODE_OF_CONDUCT.md
|
38
38
|
- Gemfile
|
39
39
|
- LICENSE.txt
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
42
|
-
- bin/console
|
43
|
-
- bin/setup
|
44
42
|
- lib/magrathea.rb
|
45
43
|
- lib/magrathea/version.rb
|
46
44
|
- magrathea.gemspec
|
@@ -54,7 +52,10 @@ files:
|
|
54
52
|
homepage: https://github.com/erikyuzwa/magrathea
|
55
53
|
licenses:
|
56
54
|
- MIT
|
57
|
-
metadata:
|
55
|
+
metadata:
|
56
|
+
homepage_uri: https://github.com/erikyuzwa/magrathea
|
57
|
+
source_code_uri: https://github.com/erikyuzwa/magrathea
|
58
|
+
changelog_uri: https://github.com/erikyuzwa/magrathea/blob/main/CHANGELOG.md
|
58
59
|
post_install_message:
|
59
60
|
rdoc_options: []
|
60
61
|
require_paths:
|
@@ -74,5 +75,6 @@ rubyforge_project:
|
|
74
75
|
rubygems_version: 2.7.6.2
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
|
-
summary:
|
78
|
+
summary: Get the conversation started to use a dark-light theme structure with your
|
79
|
+
CSS.
|
78
80
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "magrathea"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|