activeadmin_dark_color_scheme 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '078d5fcf69c3b69f130d3e3fa2dd240379f1f9c8146737b31a44c8fe07f1e9a1'
4
- data.tar.gz: 1e97a29d2a9e1bf45ad7990622b167e1491ac16ce38dd9e32f5df73f4a13e7a8
3
+ metadata.gz: f98d9beefd66f62baf67cefa1f6a1bd9dddba36f498866de62c63b0cdb237434
4
+ data.tar.gz: 640e2b08ccef1d1401ac2f216aeba3f937e1e431c5aa8bb94f1b793509aad372
5
5
  SHA512:
6
- metadata.gz: c1222e49c4caf8f313d68d41400757460bb7c40df070ffa6c143fef8b7e77e1cfceeef35f2d2a7cdb377002cc35544ac192603e5445d408a8d4b0739c9a0ab2a
7
- data.tar.gz: f281bfb3686c59bc832d8cced2b1348897c704323c47bfc412a332420ddcfff59c56c3d12c7e6a7f5a7c372f8e1b507c7dbd05535910605aef61439aadcee83a
6
+ metadata.gz: 7038435573277a48a44d32da29984b2ef31c687a946dba193b8629dbc58b8a09222a1f9d1a9de5d08bc76ae4ef836cf812caad5a51c224104b6e722913957931
7
+ data.tar.gz: 4597f5ad0611bfa38919726724ceb988272f1a9479593dc9aabf71647b56469e8fd37523a7764c5c7a64ef82604983dab43b1e2970a82df68a67547f4e2f336e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeadmin_dark_color_scheme (0.1.2)
4
+ activeadmin_dark_color_scheme (0.1.4)
5
5
  sassc-rails (~> 2, >= 2.0.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,39 +1,74 @@
1
- # Activeadmin::DarkColorScheme
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activeadmin/dark_color_scheme`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
1
+ # Dark color scheme for Activeadmin
6
2
 
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
10
6
 
11
7
  ```ruby
12
- gem 'activeadmin_dark_color_scheme'
8
+ gem "activeadmin_dark_color_scheme"
13
9
  ```
14
10
 
15
- And then execute:
11
+ Import our Sass file “activeadmin-dark-color-scheme” in your CSS entrypoint that compiles ActiveAdmin CSS files:
16
12
 
17
- $ bundle
13
+ ```sass
14
+ // app/assets/stylesheets/active_admin.sass
18
15
 
19
- Or install it yourself as:
16
+ // Your regular ActiveAdmin files
17
+ @import "active_admin/mixins"
18
+ @import "active_admin/base"
20
19
 
21
- $ gem install activeadmin_dark_color_scheme
20
+ // Dark scheme
21
+ @import "activeadmin-dark-color-scheme"
22
+ ```
22
23
 
23
- ## Usage
24
+ ## Customization
24
25
 
25
- TODO: Write usage instructions here
26
+ All [Sass variables we use](https://github.com/sergeypedan/activeadmin-dark-color-scheme/blob/master/app/assets/stylesheets/activeadmin-dark-color-scheme/variables/_all.sass) have `!default`:
26
27
 
27
- ## Development
28
+ ```sass
29
+ $link-color-1: hsl(210, 70%, 73%) !default
30
+ ```
28
31
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+ which means you can override them just by declaring your own Sass variable somewhere before.
30
33
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+ You could technically do it right in your entrypoint:
32
35
 
33
- ## Contributing
36
+ ```sass
37
+ // app/assets/stylesheets/active_admin.sass
38
+
39
+ // Your regular ActiveAdmin files
40
+ @import "active_admin/mixins"
41
+ @import "active_admin/base"
42
+
43
+ // Dark scheme
44
+ $link-color-1: crimson
45
+ @import "activeadmin-dark-color-scheme"
46
+ ```
34
47
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activeadmin_dark_color_scheme.
48
+ Or you could put your variables in a separate file and `@import` it.
49
+
50
+ ## How it works
51
+
52
+ You import additional CSS, all of which is scoped under `@media (prefers-color-scheme: dark)` media declaration that matches your system (or browser) color scheme setting.
53
+
54
+ Here is an example from [_table-index.sass](https://github.com/sergeypedan/activeadmin-dark-color-scheme/blob/master/app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_table-index.sass):
55
+
56
+ ```sass
57
+ @media (prefers-color-scheme: dark)
58
+
59
+ table.index_table
60
+ th
61
+ background-color: $panel-bg-color-solid
62
+ background-image: $panel-head-gradient
63
+ border-top-color: $th-border-color-top
64
+ border-right-color: $th-border-color-right !important
65
+ border-bottom-color: $th-border-color-bottom
66
+ border-left-color: $th-border-color-left
67
+ box-shadow: none
68
+ color: hsl(0, 0%, 95%)
69
+ text-shadow: none
70
+ ```
36
71
 
37
- ## License
72
+ ## How to disable
38
73
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
74
+ Switch to light color scheme in you system preferences or your browser developer tools.
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  "homepage_uri" => spec.homepage,
25
25
  "source_code_uri" => spec.homepage }
26
26
 
27
- spec.require_paths = ["app", "lib/activeadmin"]
27
+ spec.require_paths = ["app", "lib"]
28
28
 
29
29
  spec.bindir = "exe"
30
30
  spec.executables = []
@@ -17,5 +17,6 @@
17
17
  @import "./activeadmin-dark-color-scheme/modules/sidebar"
18
18
  @import "./activeadmin-dark-color-scheme/modules/table-attributes"
19
19
  @import "./activeadmin-dark-color-scheme/modules/table-index"
20
+ @import "./activeadmin-dark-color-scheme/modules/tabs"
20
21
  @import "./activeadmin-dark-color-scheme/modules/title-bar"
21
22
  @import "./activeadmin-dark-color-scheme/modules/top-level"
@@ -10,7 +10,21 @@
10
10
  text-shadow: none
11
11
 
12
12
  &:not(.disabled):hover
13
- background-image: linear-gradient(to bottom, lighten($btn-dark-1-gradient-stop-top, 3%), lighten($btn-dark-1-gradient-stop-bottom, 3%))
13
+ background-image: linear-gradient(to bottom, lighten($btn-dark-1-gradient-stop-top, 2%), lighten($btn-dark-1-gradient-stop-bottom, 2%))
14
+
15
+ @mixin btn-dark-1-inset
16
+ background-color: $btn-dark-1-inset-bg
17
+ background-image: linear-gradient($btn-dark-1-inset-gradient-stop-top, $btn-dark-1-inset-gradient-stop-bottom)
18
+ border-top-color: $btn-datk-1-inset-border-top-color
19
+ border-right-color: lighten($btn-dark-1-bg, 10%)
20
+ border-bottom-color: darken($btn-dark-1-gradient-stop-bottom, 10%)
21
+ border-left-color: $btn-dark-1-inset-color
22
+ box-shadow: 0 1px 3px 0 hsla(0, 0%, 0%, 0.3) inset
23
+ color: $btn-dark-1-color
24
+ text-shadow: none
25
+
26
+ &:not(.disabled):hover
27
+ background-image: linear-gradient(to bottom, lighten($btn-dark-1-inset-gradient-stop-top, 2%), lighten($btn-dark-1-inset-gradient-stop-bottom, 2%))
14
28
 
15
29
  @mixin btn-light-1
16
30
  background-color: $btn-light-1-bg
@@ -1,16 +1,24 @@
1
1
  @media (prefers-color-scheme: dark)
2
+ body.logged_out
3
+ .flash
4
+ -webkit-font-smoothing: antialiased
5
+ text-shadow: none
2
6
 
3
7
  body.logged_in
4
8
  .flash
5
- background-color: #c2b36c
6
- background-image: linear-gradient(#a99847, #a38e35)
7
- border-bottom-color: #958118 !important
8
- color: white
9
+ background-color: $alert-default-bg-color
10
+ background-image: linear-gradient($alert-default-gradient-stop-top, $alert-default-gradient-stop-bottom)
11
+ border-bottom-color: $alert-default-border-bottom-color !important
12
+ color: $alert-default-text-color
9
13
  text-shadow: none
10
14
 
11
15
  &.flash_notice
12
- background-color: #4d8750
13
- background-image: linear-gradient(#4e9a53, #4d8750)
14
- border-bottom-color: #2e7732 !important
15
- border-bottom: 1px solid #adcbaf
16
- color: #daeec8
16
+ background-color: $alert-success-bg-color
17
+ background-image: linear-gradient($alert-success-gradient-stop-top, $alert-success-gradient-stop-bottom)
18
+ border-bottom-color: $alert-success-border-bottom-color !important
19
+ color: $alert-success-text-color
20
+
21
+ .active_admin.logged_out
22
+ .flash
23
+ &.flash_alert
24
+ color: $alert-danger-text-color
@@ -0,0 +1,11 @@
1
+ @media (prefers-color-scheme: dark)
2
+ .tab-content
3
+ border-color: $tab-border-color
4
+
5
+ .ui-tabs-nav
6
+ li
7
+ a
8
+ @include btn-dark-1
9
+
10
+ &.ui-tabs-active a
11
+ @include btn-dark-1-inset
@@ -38,7 +38,31 @@ $btn-dark-1-gradient-stop-top: hsl(0, 0%, 33%) !default
38
38
  $btn-dark-1-gradient-stop-bottom: hsl(0, 0%, 29%) !default
39
39
  $btn-dark-1-color: white !default
40
40
 
41
+ $btn-dark-1-inset-bg: #3b3b3b
42
+ $btn-datk-1-inset-border-top-color: hsla(0, 0%, 0%, .01)
43
+ $btn-dark-1-inset-gradient-stop-top: #3b3b3b !default
44
+ $btn-dark-1-inset-gradient-stop-bottom: #414141 !default
45
+ $btn-dark-1-inset-color: lighten($btn-dark-1-bg, 10%)
46
+
41
47
  $btn-light-1-bg: hsl(208, 15%, 87%) !default
42
48
  $btn-light-1-gradient-stop-top: hsl(208, 15%, 87%) !default
43
49
  $btn-light-1-gradient-stop-bottom: hsl(210, 2%, 68%) !default
44
50
  $btn-light-1-color: hsl(0, 0%, 7%) !default
51
+
52
+ // Tab
53
+ $tab-border-color: hsla(0, 0%, 100%, .1) !default
54
+
55
+ // Alerts
56
+ $alert-danger-text-color: hsl(349, 57%, 53%) !default
57
+
58
+ $alert-success-bg-color: hsl(131, 39%, 33%) !default
59
+ $alert-success-gradient-stop-top: hsl(131, 39%, 33%) !default
60
+ $alert-success-gradient-stop-bottom: hsl(123, 41%, 25%) !default
61
+ $alert-success-text-color: #daeec8 !default
62
+ $alert-success-border-bottom-color: hsl(123, 45%, 26%) !default
63
+
64
+ $alert-default-bg-color: #c2b36c !default
65
+ $alert-default-gradient-stop-top: #a38e35 !default
66
+ $alert-default-gradient-stop-bottom: #a99847 !default
67
+ $alert-default-text-color: white !default
68
+ $alert-default-border-bottom-color: #958118 !default
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "autoprefixer-rails"
4
3
  require "sassc-rails"
5
4
 
6
5
  module FormtasticTristateRadio
@@ -8,12 +7,10 @@ module FormtasticTristateRadio
8
7
  # This is standard Rails way to autoload gem’s contents dynamically as an “engine”
9
8
  # @see https://guides.rubyonrails.org/engines.html Rails guide on engines
10
9
  #
11
- # module Rails
12
10
  class Engine < ::Rails::Engine
13
- initializer "bootstrap.assets" do |app|
11
+ initializer "activeadmin_dark_color_scheme.assets" do |app|
14
12
  app.config.assets.paths << root.join("assets", "stylesheets").to_s
15
13
  end
16
14
  end
17
- # end
18
15
 
19
16
  end
@@ -1,5 +1,5 @@
1
1
  module Activeadmin
2
2
  module DarkColorScheme
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "dark_color_scheme/version"
2
4
  require_relative "dark_color_scheme/engine"
3
5
 
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "activeadmin/dark_color_scheme"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_dark_color_scheme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Pedan
@@ -131,12 +131,14 @@ files:
131
131
  - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_sidebar.sass
132
132
  - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_table-attributes.sass
133
133
  - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_table-index.sass
134
+ - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_tabs.sass
134
135
  - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_title-bar.sass
135
136
  - app/assets/stylesheets/activeadmin-dark-color-scheme/modules/_top-level.sass
136
137
  - app/assets/stylesheets/activeadmin-dark-color-scheme/variables/_all.sass
137
138
  - lib/activeadmin/dark_color_scheme.rb
138
139
  - lib/activeadmin/dark_color_scheme/engine.rb
139
140
  - lib/activeadmin/dark_color_scheme/version.rb
141
+ - lib/activeadmin_dark_color_scheme.rb
140
142
  homepage: https://github.com/sergeypedan/activeadmin-dark-color-scheme
141
143
  licenses:
142
144
  - MIT
@@ -150,7 +152,7 @@ rdoc_options:
150
152
  - "--charset=UTF-8"
151
153
  require_paths:
152
154
  - app
153
- - lib/activeadmin
155
+ - lib
154
156
  required_ruby_version: !ruby/object:Gem::Requirement
155
157
  requirements:
156
158
  - - ">="