moda-themes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4edaf6d5f12812d979d46eb776cea6e5dca116154dc4a8b912b6b4b6a4db36b0
4
+ data.tar.gz: 790ca1ee94b63bb5024a96aec0ff676f7ec739f1767a1fd887ecaf3e78551296
5
+ SHA512:
6
+ metadata.gz: 63d97ff664a247865e0aca65debc3d0a68a12813d5b07e32e1a60769fcea9c670df3b517d5791b47bfeda6295ea968faecfe011e92b51cb8bbc9cdf5bb2f73cf
7
+ data.tar.gz: eb48019d39f0ccaf7f3daee23b09eafc6e2052931b93fdc3c53a9439f44c5fe09e920887801ba097ba6786cedadf839557f2f0eb91b46e275ee241f84e4dcad5
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Team Moda
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.
data/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # moda-themes
2
+
3
+ ## Meta
4
+
5
+ * **State**: development
6
+ * **Point people**: [@dzucconi](https://github.com/dzucconi)
7
+
8
+ ## Getting started
9
+
10
+ ### Ruby
11
+
12
+ Include the Ruby gem:
13
+
14
+ ```ruby
15
+ gem 'moda-themes'
16
+ ```
17
+
18
+ ```sh
19
+ bundle install
20
+ ```
21
+
22
+ Use the functions + mixins in your SASS/SCSS files:
23
+
24
+ ```scss
25
+ @import 'moda-themes';
26
+
27
+ // Include this once to generate the `data-theme` attr styling. This is not auto-included
28
+ // to prevent duplicate imports.
29
+ @include data-themes; /* Outputs =>
30
+ [data-theme=legacy] {
31
+ --theme-font-families-title: Miller Headline, Georgia, Times New Roman, Times, serif;
32
+ --theme-font-families-sans: Gotham, Helvetica Neue, Helvetica, Arial, sans-serif;
33
+ --theme-font-families-serif: Miller Headline, Georgia, Times New Roman, Times, serif;
34
+ --theme-font-families-body: Miller Headline, Georgia, Times New Roman, Times, serif;
35
+ // ...
36
+ }
37
+ [data-theme=global] {
38
+ --theme-font-families-title: Moda Operandi Serif, Times New Roman, Times, serif;
39
+ --theme-font-families-sans: Moda Operandi Sans, Arial, sans-serif;
40
+ --theme-font-families-serif: Moda Operandi Serif, Times New Roman, Times, serif;
41
+ --theme-font-families-body: Caslon, Times New Roman, Times, serif;
42
+ // ...
43
+ }
44
+ */
45
+
46
+ // Use the functions to access themed values:
47
+ p {
48
+ font-family: font-family('sans');
49
+ // font-family: var(--theme-font-families-sans);
50
+ }
51
+ ```
52
+
53
+ ### JavaScript
54
+
55
+ Install the package:
56
+
57
+ ```sh
58
+ yarn add moda-themes
59
+ ```
60
+
61
+ Configure node-sass `includePaths`:
62
+
63
+ For Parcel: Create a .sassrc.js:
64
+
65
+ ```javascript
66
+ const modaThemes = require('moda-themes');
67
+
68
+ module.exports = {
69
+ "includePaths": [
70
+ ...modaThemes.includePaths
71
+ ]
72
+ }
73
+ ```
74
+
75
+ For Webpack: Configure sass-loader:
76
+
77
+ ```javascript
78
+ const modaThemes = require("moda-themes");
79
+
80
+ const config = {
81
+ // ...
82
+ module: {
83
+ rules: [
84
+ {
85
+ test: /\.scss$/,
86
+ use: [
87
+ "style-loader",
88
+ "css-loader",
89
+ {
90
+ loader: "sass-loader",
91
+ options: { includePaths: [...modaThemes.includePaths] }
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ };
98
+
99
+ module.exports = config;
100
+ ```
101
+
102
+ Use the functions + mixins in your SASS/SCSS files:
103
+
104
+ ```scss
105
+ @import 'moda-themes';
106
+
107
+ // See above...
108
+ ```
109
+
110
+ ## Releasing
111
+
112
+ [Increment the versions](https://semver.org/) in [package.json](package.json) and [lib/moda-themes/version.rb](lib/moda-themes/version.rb).
113
+
114
+ Run `rake release` to release the Ruby gem.
115
+
116
+ Run `yarn publish` to publish the NPM package.
@@ -0,0 +1,2 @@
1
+ @import 'moda-themes/themes';
2
+ @import 'moda-themes/themer';
@@ -0,0 +1,17 @@
1
+ @import 'themes';
2
+
3
+ @mixin theme-variables-for($theme) {
4
+ @each $category-key, $category-values in map-deep-get($themes, $theme) {
5
+ @each $key, $value in $category-values {
6
+ --theme-#{$category-key}-#{$key}: #{$value};
7
+ }
8
+ }
9
+ }
10
+
11
+ @mixin data-themes() {
12
+ @each $theme-name, $_theme-values in $themes {
13
+ [data-theme="#{$theme-name}"] {
14
+ @include theme-variables-for($theme-name);
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,44 @@
1
+ $font-stack-gotham: 'Gotham', 'Helvetica Neue', Helvetica, Arial, sans-serif;
2
+ $font-stack-miller-headline: 'Miller Headline', Georgia, 'Times New Roman',
3
+ Times, serif;
4
+ $font-stack-moda-sans: 'Moda Operandi Sans', Arial, sans-serif;
5
+ $font-stack-moda-serif: 'Moda Operandi Serif', 'Times New Roman', Times, serif;
6
+ $font-stack-caslon: 'Caslon', 'Times New Roman', Times, serif;
7
+
8
+ $themes: (
9
+ legacy: (
10
+ font-families: (
11
+ title: $font-stack-miller-headline,
12
+ sans: $font-stack-gotham,
13
+ serif: $font-stack-miller-headline,
14
+ body: $font-stack-miller-headline
15
+ )
16
+ ),
17
+ global: (
18
+ font-families: (
19
+ title: $font-stack-moda-serif,
20
+ sans: $font-stack-moda-sans,
21
+ serif: $font-stack-moda-serif,
22
+ body: $font-stack-caslon
23
+ )
24
+ )
25
+ );
26
+
27
+ @function map-deep-get($map, $keys...) {
28
+ @each $key in $keys {
29
+ $map: map-get($map, $key);
30
+ }
31
+ @return $map;
32
+ }
33
+
34
+ @function theme($theme, $keys...) {
35
+ @return map-deep-get($themes, $theme, $keys...);
36
+ }
37
+
38
+ @function v($var) {
39
+ @return var(--#{$var});
40
+ }
41
+
42
+ @function font-family($name) {
43
+ @return v('theme-font-families-#{$name}');
44
+ }
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ModaThemes
4
+ VERSION = '0.0.1'
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'moda-themes/version'
2
+
3
+ module ModaThemes
4
+ if defined?(Rails) && defined?(Rails::Engine)
5
+ class Engine < ::Rails::Engine
6
+ config.assets.paths << File.expand_path("./assets", __dir__)
7
+ end
8
+ else
9
+ begin
10
+ require "sass"
11
+ Sass.load_paths << File.expand_path("./assets", __dir__)
12
+ rescue LoadError
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: moda-themes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - dzucconi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-07-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '9.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '9.0'
83
+ description:
84
+ email:
85
+ - damon.zucconi@modaoperandi.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - LICENSE.md
91
+ - README.md
92
+ - lib/assets/stylesheets/_moda-themes.scss
93
+ - lib/assets/stylesheets/moda-themes/_themer.scss
94
+ - lib/assets/stylesheets/moda-themes/_themes.scss
95
+ - lib/moda-themes.rb
96
+ - lib/moda-themes/version.rb
97
+ homepage: https://github.com/ModaOperandi/themes
98
+ licenses:
99
+ - MIT
100
+ metadata:
101
+ homepage_uri: https://github.com/ModaOperandi/themes
102
+ source_code_uri: https://github.com/ModaOperandi/themes
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubygems_version: 3.0.4
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: Constant themed values for modaoperandi.com
122
+ test_files: []