solidify 0.0.1.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +40 -0
  5. data/.travis.yml +10 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +3 -0
  8. data/Guardfile +51 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +75 -0
  11. data/Rakefile +42 -0
  12. data/app/controllers/concerns/solidify/liquid.rb +26 -0
  13. data/app/controllers/solidify/addresses_controller.rb +15 -0
  14. data/app/controllers/solidify/carts_controller.rb +15 -0
  15. data/app/controllers/solidify/collections_controller.rb +26 -0
  16. data/app/controllers/solidify/customers_controller.rb +16 -0
  17. data/app/controllers/solidify/home_controller.rb +15 -0
  18. data/app/controllers/solidify/liquid_controller.rb +25 -0
  19. data/app/controllers/solidify/orders_controller.rb +19 -0
  20. data/app/controllers/solidify/pages_controller.rb +22 -0
  21. data/app/controllers/solidify/products_controller.rb +34 -0
  22. data/app/controllers/solidify/registrations_controller.rb +25 -0
  23. data/app/controllers/solidify/responders/solidify/liquid_responder.rb +29 -0
  24. data/app/controllers/solidify/search_controller.rb +41 -0
  25. data/app/controllers/solidify/sessions_controller.rb +15 -0
  26. data/app/drops/rails_settings/scoped_settings_drop.rb +11 -0
  27. data/app/drops/solidify/errors_drop.rb +14 -0
  28. data/app/drops/solidify/link_drop.rb +15 -0
  29. data/app/drops/solidify/link_list_drop.rb +7 -0
  30. data/app/drops/solidify/nil_drop.rb +7 -0
  31. data/app/drops/solidify/page_drop.rb +7 -0
  32. data/app/drops/solidify/search_drop.rb +7 -0
  33. data/app/drops/spree/address_drop.rb +28 -0
  34. data/app/drops/spree/image_drop.rb +32 -0
  35. data/app/drops/spree/line_item_drop.rb +98 -0
  36. data/app/drops/spree/option_type_drop.rb +4 -0
  37. data/app/drops/spree/order_drop.rb +64 -0
  38. data/app/drops/spree/product_drop.rb +97 -0
  39. data/app/drops/spree/taxon_drop.rb +53 -0
  40. data/app/drops/spree/user_drop.rb +54 -0
  41. data/app/drops/spree/variant_drop.rb +111 -0
  42. data/app/fields/spree/address_fields.rb +18 -0
  43. data/app/fields/spree/image_fields.rb +12 -0
  44. data/app/fields/spree/line_item_fields.rb +21 -0
  45. data/app/fields/spree/order_fields.rb +22 -0
  46. data/app/fields/spree/product_fields.rb +22 -0
  47. data/app/fields/spree/taxon_fields.rb +18 -0
  48. data/app/fields/spree/user_fields.rb +14 -0
  49. data/app/fields/spree/variant_fields.rb +19 -0
  50. data/app/filters/solidify/additional_filters.rb +22 -0
  51. data/app/filters/solidify/html_filters.rb +16 -0
  52. data/app/filters/solidify/money_filters.rb +39 -0
  53. data/app/filters/solidify/string_filters.rb +47 -0
  54. data/app/filters/solidify/url_filters.rb +59 -0
  55. data/app/helpers/solidify/liquid_helper.rb +111 -0
  56. data/app/helpers/solidify/shop_helper.rb +7 -0
  57. data/app/models/concerns/solidify/address.rb +15 -0
  58. data/app/models/concerns/solidify/full_name.rb +11 -0
  59. data/app/models/concerns/solidify/handle.rb +25 -0
  60. data/app/models/concerns/solidify/inventory_policy.rb +7 -0
  61. data/app/models/concerns/solidify/validation_cancel.rb +33 -0
  62. data/app/models/concerns/spree/order_state.rb +19 -0
  63. data/app/models/solidify/asset.rb +12 -0
  64. data/app/models/solidify/link.rb +10 -0
  65. data/app/models/solidify/link_list.rb +7 -0
  66. data/app/models/solidify/page.rb +5 -0
  67. data/app/models/solidify/setting.rb +8 -0
  68. data/app/models/solidify/theme.rb +19 -0
  69. data/app/models/spree/address_decorator.rb +13 -0
  70. data/app/models/spree/image_decorator.rb +7 -0
  71. data/app/models/spree/line_item_decorator.rb +7 -0
  72. data/app/models/spree/order_decorator.rb +10 -0
  73. data/app/models/spree/product_decorator.rb +8 -0
  74. data/app/models/spree/taxon_decorator.rb +20 -0
  75. data/app/models/spree/user_decorator.rb +9 -0
  76. data/app/models/spree/variant_decorator.rb +11 -0
  77. data/app/poro/solidify/search.rb +14 -0
  78. data/app/services/solidify/app_specific_string_io.rb +15 -0
  79. data/app/services/solidify/asset_compiler.rb +11 -0
  80. data/app/services/solidify/asset_postprocessor.rb +53 -0
  81. data/app/services/solidify/collections_all_builder.rb +12 -0
  82. data/app/services/solidify/link_list_seeder.rb +26 -0
  83. data/app/services/solidify/liquid_asset_compiler.rb +19 -0
  84. data/app/services/solidify/scss_asset_compiler.rb +15 -0
  85. data/app/services/solidify/shop_settings_seeder.rb +26 -0
  86. data/app/services/solidify/theme_mechanic.rb +30 -0
  87. data/app/uploaders/solidify/asset_uploader.rb +10 -0
  88. data/app/views/solidify/global/content_for_header.html.erb +0 -0
  89. data/app/views/solidify/themes/skeleton-theme/README.md +54 -0
  90. data/app/views/solidify/themes/skeleton-theme/assets/arrow-down.svg.liquid +3 -0
  91. data/app/views/solidify/themes/skeleton-theme/assets/cart.svg.liquid +4 -0
  92. data/app/views/solidify/themes/skeleton-theme/assets/shop.js.liquid +75 -0
  93. data/app/views/solidify/themes/skeleton-theme/assets/shopify_common.js +14 -0
  94. data/app/views/solidify/themes/skeleton-theme/assets/style.scss.liquid +768 -0
  95. data/app/views/solidify/themes/skeleton-theme/config/settings.html +217 -0
  96. data/app/views/solidify/themes/skeleton-theme/config/settings_data.json +26 -0
  97. data/app/views/solidify/themes/skeleton-theme/layout/theme.liquid +181 -0
  98. data/app/views/solidify/themes/skeleton-theme/snippets/article-grid-item.liquid +73 -0
  99. data/app/views/solidify/themes/skeleton-theme/snippets/collection-grid-item.liquid +46 -0
  100. data/app/views/solidify/themes/skeleton-theme/snippets/collection-listing.liquid +46 -0
  101. data/app/views/solidify/themes/skeleton-theme/snippets/open-graph-tags.liquid +35 -0
  102. data/app/views/solidify/themes/skeleton-theme/snippets/product-grid-item.liquid +70 -0
  103. data/app/views/solidify/themes/skeleton-theme/snippets/site-nav.liquid +57 -0
  104. data/app/views/solidify/themes/skeleton-theme/snippets/social-links.liquid +42 -0
  105. data/app/views/solidify/themes/skeleton-theme/snippets/twitter-card.liquid +41 -0
  106. data/app/views/solidify/themes/skeleton-theme/templates/404.liquid +2 -0
  107. data/app/views/solidify/themes/skeleton-theme/templates/article.liquid +160 -0
  108. data/app/views/solidify/themes/skeleton-theme/templates/blog.grid.liquid +30 -0
  109. data/app/views/solidify/themes/skeleton-theme/templates/blog.liquid +92 -0
  110. data/app/views/solidify/themes/skeleton-theme/templates/cart.liquid +123 -0
  111. data/app/views/solidify/themes/skeleton-theme/templates/collection.liquid +102 -0
  112. data/app/views/solidify/themes/skeleton-theme/templates/customers/account.liquid +57 -0
  113. data/app/views/solidify/themes/skeleton-theme/templates/customers/activate_account.liquid +26 -0
  114. data/app/views/solidify/themes/skeleton-theme/templates/customers/addresses.liquid +173 -0
  115. data/app/views/solidify/themes/skeleton-theme/templates/customers/login.liquid +90 -0
  116. data/app/views/solidify/themes/skeleton-theme/templates/customers/order.liquid +103 -0
  117. data/app/views/solidify/themes/skeleton-theme/templates/customers/register.liquid +32 -0
  118. data/app/views/solidify/themes/skeleton-theme/templates/customers/reset_password.liquid +27 -0
  119. data/app/views/solidify/themes/skeleton-theme/templates/index.liquid +39 -0
  120. data/app/views/solidify/themes/skeleton-theme/templates/list-collections.liquid +19 -0
  121. data/app/views/solidify/themes/skeleton-theme/templates/page.liquid +16 -0
  122. data/app/views/solidify/themes/skeleton-theme/templates/product.liquid +202 -0
  123. data/app/views/solidify/themes/skeleton-theme/templates/search.liquid +72 -0
  124. data/bin/rails +12 -0
  125. data/config/app.yml +0 -0
  126. data/config/initializers/carrierwave.rb +25 -0
  127. data/config/initializers/devise.rb +286 -0
  128. data/config/initializers/form_tag.rb +43 -0
  129. data/config/initializers/liquid.rb +213 -0
  130. data/config/initializers/sass.rb +15 -0
  131. data/config/initializers/spree.rb +7 -0
  132. data/config/initializers/theme_settings.rb +29 -0
  133. data/config/routes.rb +52 -0
  134. data/config/spring.rb +2 -0
  135. data/db/migrate/20170223064316_create_solidify_assets.solidify.rb +14 -0
  136. data/db/migrate/20170223064317_create_solidify_themes.solidify.rb +10 -0
  137. data/db/migrate/20170223064318_create_solidify_link_lists.solidify.rb +12 -0
  138. data/db/migrate/20170223064319_create_solidify_links.solidify.rb +13 -0
  139. data/db/migrate/20170223064320_create_solidify_settings.solidify.rb +22 -0
  140. data/db/migrate/20170223064321_create_solidify_pages.solidify.rb +16 -0
  141. data/db/migrate/20170223064322_add_attributes_to_spree_users.solidify.rb +7 -0
  142. data/db/migrate/20170223064323_add_handle_to_spree_taxons.solidify.rb +7 -0
  143. data/db/migrate/20170228115149_add_state_and_country_fields_to_spree_addresses.solidify.rb +7 -0
  144. data/lib/generators/solidify/install/install_generator.rb +23 -0
  145. data/lib/solidify.rb +11 -0
  146. data/lib/solidify/configuration.rb +21 -0
  147. data/lib/solidify/engine.rb +24 -0
  148. data/lib/solidify/testing_support/factories.rb +5 -0
  149. data/lib/solidify/testing_support/factories/assets.rb +75 -0
  150. data/lib/solidify/testing_support/factories/solidify_pages.rb +10 -0
  151. data/lib/solidify/testing_support/factories/spree_addresses.rb +9 -0
  152. data/lib/solidify/testing_support/factories/spree_line_items.rb +10 -0
  153. data/lib/solidify/testing_support/factories/spree_orders.rb +9 -0
  154. data/lib/solidify/testing_support/factories/spree_products.rb +8 -0
  155. data/lib/solidify/testing_support/factories/spree_taxons.rb +7 -0
  156. data/lib/solidify/testing_support/factories/spree_variants.rb +7 -0
  157. data/lib/solidify/testing_support/factories/themes.rb +7 -0
  158. data/lib/solidify/version.rb +3 -0
  159. data/lib/tasks/download_theme.rake +18 -0
  160. data/lib/tasks/seed_default_theme.rake +8 -0
  161. data/lib/tasks/seed_everything.rake +12 -0
  162. data/lib/tasks/seed_link_list.rake +8 -0
  163. data/lib/tasks/seed_shop_settings.rake +8 -0
  164. data/solidify.gemspec +61 -0
  165. metadata +668 -0
@@ -0,0 +1,26 @@
1
+ module Solidify
2
+ class ShopSettingsSeeder
3
+ def initialize(theme_id)
4
+ @theme_id = theme_id
5
+ end
6
+
7
+ # rubocop:disable Metrics/MethodLength
8
+ def seed
9
+ {
10
+ 'active_theme_id' => @theme_id,
11
+ 'checkout' => { 'guest_login' => false },
12
+ 'currency' => 'USD',
13
+ 'customer_accounts_enabled' => true,
14
+ 'customer_accounts_optional' => true,
15
+ 'description' => '',
16
+ 'domain' => ENV.fetch('DOMAIN_NAME'),
17
+ 'enabled_payment_types' => nil,
18
+ 'money_format' => '€{{amount}}',
19
+ 'money_with_currency_format' => '€{{amount}} EUR',
20
+ 'name' => 'Split'
21
+ }.each do |k, v|
22
+ Solidify::Setting[k] = v
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,30 @@
1
+ module Solidify
2
+ class ThemeMechanic
3
+ def self.create(name: 'Simple',
4
+ path: Solidify::Engine.root.join(
5
+ 'app', 'views', 'solidify', 'themes', 'skeleton-theme'
6
+ ))
7
+ theme = Theme.new(name: name)
8
+
9
+ files = Dir.glob("#{path}/**/*")
10
+ instantiate_assets_from_files(path, files, theme)
11
+
12
+ theme.save!
13
+ theme
14
+ end
15
+
16
+ def self.instantiate_assets_from_files(path, files, theme)
17
+ files.each do |file|
18
+ next if Dir.exist?(file) # skip directories
19
+ theme.assets << asset_from_file(path, file)
20
+ end
21
+ end
22
+
23
+ def self.asset_from_file(path, file)
24
+ Asset.new(
25
+ key: Pathname.new(file).relative_path_from(path).to_s,
26
+ file: File.open(file)
27
+ )
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,10 @@
1
+ module Solidify
2
+ class AssetUploader < ::CarrierWave::Uploader::Base
3
+ def store_dir
4
+ asset_file_dir = model.key.split('/')
5
+ asset_file_dir.pop
6
+ asset_file_dir = asset_file_dir.join('/')
7
+ "themes/#{model.theme_id}/#{asset_file_dir}"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,54 @@
1
+ Skeleton theme
2
+ ============
3
+
4
+ The Skeleton theme is a simplified Shopify theme, to be used as a "blank slate" starting point for theme designers.
5
+
6
+ <b>Features:</b>
7
+ - Almost no theme settings. Ready to be customized any way you want.
8
+ - Only ~500 lines of CSS including comments.
9
+ - Despite its 500 lines of CSS code, it is responsive and has styled drop-down menus.
10
+ - Include SVG images to style select elements and cart icon.
11
+ - Commented code to teach you Liquid concepts in practice.
12
+
13
+ <b>Demo:</b>
14
+
15
+ - [Demo store](http://skeleton.myshopify.com/)
16
+
17
+ Designing a store for a client? Earn 20% revenue through our <a href="http://www.shopify.com/partners">Partner program<a/>.
18
+
19
+ Getting started
20
+ ---------------------
21
+ 1. <a href="https://github.com/Shopify/skeleton-theme/archive/master.zip">Download</a> the latest version
22
+ 2. or clone the git repo: <code>git clone https://github.com/Shopify/skeleton-theme.git</code>
23
+
24
+ Basic structure
25
+ ---------------
26
+ ```
27
+ ├── assets
28
+ │ └── Javascript, CSS, and theme images
29
+ ├── config
30
+ │ └── custom Theme Settings
31
+ ├── layout
32
+ │ ├── theme.liquid
33
+ │ └── optional alternate layouts
34
+ ├── snippets
35
+ │ └── optional custom code snippets
36
+ ├── templates
37
+ │ ├── 404.liquid
38
+ │ ├── article.liquid
39
+ │ ├── blog.liquid
40
+ │ ├── cart.liquid
41
+ │ ├── collection.liquid
42
+ │ ├── index.liquid
43
+ │ ├── page.liquid
44
+ │ ├── product.liquid
45
+ │ └── search.liquid
46
+ │ └── list-collections.liquid
47
+ ```
48
+
49
+ Additional resources
50
+ ---------------------
51
+ - <a href="http://meetup.shopify.com/">Free workshops</a>: Sign up for a free Shopify For Designers workshop in a city near you.
52
+ - <a href="http://docs.shopify.com/themes">Theme Documentation</a>: Learn more about Liquid and theme templates.
53
+ - <a href="http://apps.shopify.com/desktop-theme-editor">Desktop Theme Editor</a>: For Mac OS X users, we recommend our free app to sync theme files in development.
54
+ - Need more help? Ask a question in our <a href="http://ecommerce.shopify.com/c/ecommerce-design"> Design Forums</a>.
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="15px" height="15px" version="1.1" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
2
+ <path x="0" y="0" width="100" height="100" fill="{{ settings.text_color }}" d="M50.1 72.7c-1.1 0-2.1-0.4-2.8-1.2L17.3 41.5c-1.6-1.6-1.6-4.1 0-5.7 1.6-1.6 4.1-1.6 5.7 0l27.2 27.2 27.2-27.2c1.6-1.6 4.1-1.6 5.7 0 1.6 1.6 1.6 4.1 0 5.7L52.9 71.5C52.2 72.2 51.2 72.7 50.1 72.7z"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ {% assign height = settings.base_font_size | remove: 'px' | times: 0.8 | append: 'px' %}
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="{{ height }}" height="{{ height }}" viewBox="0 0 512 512" fill="{{ settings.text_color }}">
3
+ <path d="M423.6 288c17.6 0 36-13.8 40.8-30.8l46.4-162.5C515.7 77.8 505.2 64 487.6 64L160 64c0-35.3-28.7-64-64-64L0 0l0 64 96 0 0 272c0 26.5 21.5 48 48 48l304 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L160 320l0-32L423.6 288zM160 128l289.4 0 -27.4 96L160 224 160 128zM192 472c0 22-18 40-40 40l-16 0c-22 0-40-18-40-40l0-16c0-22 18-40 40-40l16 0c22 0 40 18 40 40L192 472zM480 472c0 22-18 40-40 40l-16 0c-22 0-40-18-40-40l0-16c0-22 18-40 40-40l16 0c22 0 40 18 40 40L480 472z"/>
4
+ </svg>
@@ -0,0 +1,75 @@
1
+ /*============================*/
2
+ /* Update main product image. */
3
+ /*============================*/
4
+ var switchImage = function(newImageSrc, newImage, mainImageDomEl) {
5
+ // newImageSrc is the path of the new image in the same size as originalImage is sized.
6
+ // newImage is Shopify's object representation of the new image, with various attributes, such as scr, id, position.
7
+ // mainImageDomEl is the passed domElement, which has not yet been manipulated. Let's manipulate it now.
8
+ jQuery(mainImageDomEl).parents('a').attr('href', newImageSrc.replace('_grande', '_1024x1024'));
9
+ jQuery(mainImageDomEl).attr('src', newImageSrc);
10
+ };
11
+
12
+ jQuery(function($) {
13
+
14
+ /* Placeholder JS */
15
+ /*==========================*/
16
+ var test = document.createElement('input');
17
+ if (!('placeholder' in test)) {
18
+ $('[placeholder]').each(function(){
19
+ if ($(this).val() === '') {
20
+ var hint = $(this).attr('placeholder');
21
+ $(this).val(hint).addClass('hint');
22
+ }
23
+ });
24
+ $('[placeholder]').focus(function() {
25
+ if ($(this).val() === $(this).attr('placeholder')) {
26
+ $(this).val('').removeClass('hint');
27
+ }
28
+ }).blur(function() {
29
+ if ($(this).val() === '') {
30
+ $(this).val($(this).attr('placeholder')).addClass('hint');
31
+ }
32
+ });
33
+ }
34
+
35
+ /* Form validation JS */
36
+ /*==========================*/
37
+
38
+ $('input.error, textarea.error').focus(function() {
39
+ $(this).removeClass('error');
40
+ });
41
+
42
+ $('form :submit').click(function() {
43
+ $(this).parents('form').find('input.hint, textarea.hint').each(function() {
44
+ $(this).val('').removeClass('hint');
45
+ });
46
+ return true;
47
+ });
48
+
49
+ /* Remove SVG images to avoid broken images in all browsers that don't support SVG. */
50
+ /*==========================*/
51
+
52
+ var supportsSVG = function() {
53
+ return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1');
54
+ }
55
+ if (!supportsSVG()) {
56
+ $('img[src*=".svg"]').remove();
57
+ }
58
+
59
+ /* Prepare to have floated images fill the width of the design on blog pages on small devices. */
60
+ /*==========================*/
61
+
62
+ var images = $('.article img').load(function() {
63
+ var src = $(this).attr('src').replace(/_grande\.|_large\.|_medium\.|_small\./, '.');
64
+ var width = $(this).width();
65
+ $(this).attr('src', src).attr('width', width).removeAttr('height');
66
+ });
67
+
68
+ /* Update main product image when a thumbnail is clicked. */
69
+ /*==========================*/
70
+ $('.product-photo-thumb a').on('click', function(e) {
71
+ e.preventDefault();
72
+ switchImage($(this).attr('href'), null, $('.product-photo-container img')[0]);
73
+ } );
74
+
75
+ });
@@ -0,0 +1,14 @@
1
+ /* =======================================================================
2
+ Reading query parameters and storing them in a Shopify.queryParams object.
3
+ Necessary for collection sorting and advanced collection filtering.
4
+ ======================================================================= */
5
+
6
+ Shopify.queryParams = {};
7
+ if (location.search.length) {
8
+ for (var aKeyValue, i = 0, aCouples = location.search.substr(1).split('&'); i < aCouples.length; i++) {
9
+ aKeyValue = aCouples[i].split('=');
10
+ if (aKeyValue.length > 1) {
11
+ Shopify.queryParams[decodeURIComponent(aKeyValue[0])] = decodeURIComponent(aKeyValue[1]);
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,768 @@
1
+ /*!normalize.css v3.0.1 | MIT License | git.io/normalize */ html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,progress,video{display:inline-block;vertical-align:baseline;}audio:not([controls]){display:none;height:0;}[hidden],template{display:none;}a{background:transparent;}a:active,a:hover{outline:0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}h1{font-size:2em;margin:.67em 0;}mark{background:#ff0;color:#000;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:1em 40px;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}pre{overflow:auto;}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}button{overflow:visible;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}input{line-height:normal;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em;}legend{border:0;padding:0;}textarea{overflow:auto;}optgroup{font-weight:bold;}table{border-collapse:collapse;border-spacing:0;}td,th{padding:0;}
2
+
3
+ /* ==========================================================================
4
+ Most theme settings should be stored in Sassy CSS variables here, for reuse.
5
+ ========================================================================== */
6
+ /*!theme settings */
7
+ $site-max-width: 60 * {{ settings.base_font_size }};
8
+ $breakpoint-small-screen: 30 * {{ settings.base_font_size }};
9
+ $gutter: 1 * {{ settings.base_font_size }};
10
+ $background-color: {{ settings.background_color }};
11
+ $text-color: {{ settings.text_color }};
12
+ $link-color: {{ settings.link_color }};
13
+ $base-font-family: {{ settings.base_font_family }};
14
+ $base-font-size: {{ settings.base_font_size }};
15
+ $heading-font-family: $base-font-family;
16
+ $heading-font-weight: 600;
17
+
18
+ /* Table of content */
19
+ /* 1. Base styles
20
+ 2. Forms
21
+ 3. Tables
22
+ 4. Layout
23
+ 5. Header
24
+ 6. Navigation
25
+ 7. Tags
26
+ 8. Social and payment methods
27
+ 9. Blog
28
+ 10. Product and collection pages
29
+ 11. Search form and search results
30
+ 12. Footer
31
+ */
32
+
33
+ /* =====================
34
+ 1. Base styles
35
+ ===================== */
36
+
37
+ html, body {
38
+ background-color: $background-color;
39
+ font-size: $base-font-size;
40
+ line-height: 1.6;
41
+ font-family: $base-font-family;
42
+ color: $text-color;
43
+ }
44
+
45
+ .paragraph-margins { margin: 0 0 .75 * $gutter; }
46
+ .grid-margins { margin: 0 0 $gutter; }
47
+ .section-margins { margin: 0 0 2 * $gutter; }
48
+
49
+ h1, h2, h3, h4, h5, h6 {
50
+ font-family: $heading-font-family;
51
+ font-weight: $heading-font-weight;
52
+ text-rendering: optimizeLegibility; /* to enable ligatures and kerning */
53
+ @extend .paragraph-margins;
54
+ }
55
+
56
+ /* http://modularscale.com/scale/?px1=16&px2=32&ra1=1.667&ra2=0 */
57
+
58
+ .tera {
59
+ font-size: 5.558 * $base-font-size;
60
+ line-height: 1;
61
+ }
62
+
63
+ .giga {
64
+ font-size: 4.632 * $base-font-size;
65
+ line-height: 1;
66
+ }
67
+
68
+ .mega {
69
+ font-size: 3.334 * $base-font-size;
70
+ line-height: 1;
71
+ }
72
+
73
+ .alpha, h1 {
74
+ font-size: 2.779 * $base-font-size;
75
+ line-height: 1.1;
76
+ }
77
+
78
+ .beta, h2 {
79
+ font-size: 2 * $base-font-size;
80
+ line-height: 1.1;
81
+ }
82
+
83
+ .gamma, h3 {
84
+ font-size: 1.667 * $base-font-size;
85
+ line-height: 1.2;
86
+ }
87
+
88
+ .delta, h4 {
89
+ font-size: 1.2 * $base-font-size;
90
+ line-height: 1.4;
91
+ }
92
+
93
+ .epsilon, h5 {
94
+ font-size: 1 * $base-font-size;
95
+ line-height: 1.6;
96
+ }
97
+
98
+ .zeta, h6 {
99
+ font-size: 0.72 * $base-font-size;
100
+ line-height: 1.6;
101
+ }
102
+
103
+ /* Styling all pages main heading in one fell swoop. */
104
+ #main > h1, #main .title, .product-details h1 {
105
+ @extend .beta;
106
+ }
107
+
108
+ /* Responsive images and videos. */
109
+ img, iframe { max-width: 100%; }
110
+
111
+ .quiet { color: lighten( $text-color, 10% ); }
112
+ .hint { color: lighten( $text-color, 15% ); }
113
+ i, em { font-style: italic; }
114
+ b, strong { font-weight: 600; }
115
+ .small-print { @extend .zeta; }
116
+
117
+ a {
118
+ color: $link-color;
119
+ text-decoration: none;
120
+ &:hover {
121
+ color: darken( $link-color, 10% );
122
+ }
123
+ header &, footer & {
124
+ white-space: nowrap;
125
+ color: $text-color;
126
+ }
127
+ header &:hover, footer &:hover {
128
+ color: darken( $text-color, 10% );
129
+ }
130
+ }
131
+
132
+ section, #customer { @extend .section-margins; }
133
+ p, form > div { @extend .paragraph-margins; }
134
+
135
+ /* No list style for lists except in RTE content. */
136
+ ul, ol {
137
+ list-style-type: none;
138
+ @extend .section-margins;
139
+ padding: 0;
140
+ }
141
+ .rte ul {
142
+ list-style-type: disc;
143
+ list-style-position: inside;
144
+ @extend .paragraph-margins;
145
+ }
146
+ .rte ol {
147
+ list-style-type: decimal;
148
+ list-style-position: inside;
149
+ @extend .paragraph-margins;
150
+ }
151
+
152
+ /* =================
153
+ 2. Forms
154
+ ================= */
155
+
156
+ /* Remove placeholder text in inputs when they get focus. */
157
+ input:focus::-webkit-input-placeholder { color: transparent; }
158
+ input:focus::-moz-placeholder { color:transparent; }
159
+
160
+ label {
161
+ display: block;
162
+ }
163
+
164
+ select {
165
+ display: inline-block;
166
+ margin: 0;
167
+ padding: .3em 2em .3em 0.6em;
168
+ color: $text-color;
169
+ border: 0;
170
+ border-radius: .25em;
171
+ cursor: pointer;
172
+ outline: 0;
173
+ -webkit-appearance: none;
174
+ -moz-appearance: none;
175
+ appearance: none;
176
+ background: url({{ 'arrow-down.svg' | asset_url }}) right 0.4em center no-repeat;
177
+ background-color: darken( $background-color, 7% );
178
+ }
179
+
180
+ @-moz-document url-prefix() {
181
+ /* Impossible to hide the native arrow in Firefox.
182
+ https://gist.github.com/joaocunha/6273016
183
+ Please upvote the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=649849 */
184
+ select {
185
+ background-image: none;
186
+ padding-right: 0;
187
+ }
188
+ /* Getting rid of dotted line around text in Firefox. */
189
+ select:-moz-focusring {
190
+ color: transparent;
191
+ text-shadow: 0 0 0 #000;
192
+ }
193
+ }
194
+
195
+ /* Getting rid of arrow in IE10 and IE11. */
196
+ select::-ms-expand {
197
+ display: none;
198
+ }
199
+
200
+ /* Using default arrow with no box in IE8 and IE9. */
201
+ .ie8 select, .ie9 select {
202
+ background: darken( $background-color, 20% ) none;
203
+ padding: 5px;
204
+ border: 1px;
205
+ }
206
+
207
+ /* Text inputs. */
208
+ %input {
209
+ display: inline-block;
210
+ max-width: 100%;
211
+ padding: .4em .6em;
212
+ background-color: transparent;
213
+ border: darken( $background-color, 10% ) 1px solid;
214
+ border-radius: .25em;
215
+ outline: none;
216
+ -webkit-appearance: none;
217
+ }
218
+
219
+ textarea, input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="date"], input[type="search"], input[type="number"], input[type="password"] {
220
+ @extend %input;
221
+ }
222
+
223
+ .input.small { width: 50px; }
224
+
225
+ .input.medium { width: 150px; }
226
+
227
+ .input.large { width: 300px; }
228
+
229
+ .input.full-width { width: 100%; }
230
+
231
+ textarea, input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="date"], input[type="password"] {
232
+ @extend .input.large;
233
+ @media (max-width: $breakpoint-small-screen) {
234
+ width: 100%;
235
+ }
236
+ }
237
+
238
+ input[type="search"], #searchresults input[type="search"] {
239
+ @extend .input.medium;
240
+ }
241
+
242
+ input.quantity, input[type="number"] {
243
+ @extend .input.small;
244
+ }
245
+
246
+ /* All buttons. */
247
+ .button {
248
+ display: inline-block;
249
+ padding: .4em .6em;
250
+ background-color: darken( $background-color, 10%);
251
+ border: darken( $background-color, 10%) 1px solid;
252
+ border-radius: .25em;
253
+ text-decoration: none;
254
+ text-transform: uppercase;
255
+ text-rendering: optimizeLegibility;
256
+ &:hover {
257
+ background-color: darken( $background-color, 20%);
258
+ }
259
+ }
260
+
261
+ .disabled {
262
+ pointer-events: none;
263
+ opacity: 0.5;
264
+ }
265
+
266
+ input[type="submit"], input[type="button"], button {
267
+ @extend .button;
268
+ }
269
+
270
+ #searchresults input[type="submit"] { width: inherit; }
271
+
272
+ /* Big, important buttons get a special treatment */
273
+ .primary.button {
274
+ padding: .5em .7em;
275
+ font-size: 1.2rem;
276
+ background-color: $link-color;
277
+ border-color: $link-color;
278
+ color: $background-color;
279
+ &:hover {
280
+ background-color: darken( $link-color, 10% );
281
+ }
282
+ }
283
+
284
+ /* For search and newsletter forms, eliminate any spacing between the text box and submit button on the right. */
285
+ .inline-collapse {
286
+ @extend .clearfix;
287
+ & input {
288
+ float: left;
289
+ }
290
+ & input:first-child {
291
+ border-top-right-radius: 0;
292
+ border-bottom-right-radius: 0;
293
+ }
294
+ & input:last-child {
295
+ border-top-left-radius: 0;
296
+ border-bottom-left-radius: 0;
297
+ }
298
+ }
299
+
300
+ /* For IE8. */
301
+ .lt-ie9 .inline-collapse input, .lt-ie9 #searchresults .inline-collapse input { display: inline-block; zoom: 1; width: 130px; }
302
+ .lt-ie9 .inline-collapse { display: block; width: 300px; }
303
+
304
+ /* ================
305
+ 3. Tables
306
+ ================ */
307
+
308
+ table {
309
+ width: 100%;
310
+ @extend .section-margins;
311
+ th, td {
312
+ padding: 1em;
313
+ }
314
+ tr {
315
+ border-bottom: darken( $background-color, 10%) 1px solid;
316
+ }
317
+ th {
318
+ text-align: left;
319
+ }
320
+ }
321
+
322
+ /* ================
323
+ 4. Layout
324
+ ================ */
325
+
326
+ /* Control the web page maximum width. */
327
+ .container {
328
+ width: 85%;
329
+ max-width: $site-max-width;
330
+ margin: 0 auto;
331
+ padding: $gutter 0;
332
+ }
333
+
334
+ /* Safeguards for floats. */
335
+ header, #main, footer {
336
+ @extend .clear;
337
+ @extend .clearfix;
338
+ }
339
+
340
+ /* Add some space below main section. */
341
+ header, #main {
342
+ @extend .section-margins;
343
+ }
344
+
345
+ /* Using border-box makes it easier to work with grids:
346
+ See http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
347
+ *, *:before, *:after {
348
+ -moz-box-sizing: border-box;
349
+ -webkit-box-sizing: border-box;
350
+ box-sizing: border-box;
351
+ }
352
+
353
+ /* The Grid. */
354
+ .row {
355
+ margin-left: -$gutter;
356
+ margin-right: -$gutter;
357
+ margin-bottom: $gutter;
358
+ clear: both;
359
+ }
360
+ .column {
361
+ float: left;
362
+ padding-left: $gutter;
363
+ padding-right: $gutter;
364
+ padding-bottom: $gutter;
365
+ }
366
+ .column.full { width: 100%; }
367
+ .column.three-quarters { width: 75%; }
368
+ .column.two-thirds { width: 66.6%; }
369
+ .column.half { width: 50%; }
370
+ .column.third { width: 33.3%; }
371
+ .column.fourth { width: 25%; }
372
+ .column.fifth { width: 20%; }
373
+ .column.sixth { width: 16.6%; }
374
+ .column.flow-opposite { float: right; }
375
+ .grid {
376
+ @extend .row;
377
+ }
378
+ .grid > li {
379
+ @extend .column;
380
+ }
381
+ .two-per-row {
382
+ @extend .column.half;
383
+ }
384
+ .three-per-row {
385
+ @extend .column.third;
386
+ }
387
+ .four-per-row {
388
+ @extend .column.fourth;
389
+ }
390
+ .five-per-row {
391
+ @extend .column.fifth;
392
+ }
393
+ .six-per-row {
394
+ @extend .column.sixth;
395
+ }
396
+ .product {
397
+ @extend .row;
398
+ }
399
+ .product-photos, .product-details {
400
+ @extend .column;
401
+ @extend .column.half;
402
+ }
403
+
404
+ @media (max-width: $breakpoint-small-screen) {
405
+ .column {
406
+ float: none;
407
+ width: 100% !important;
408
+ }
409
+ }
410
+
411
+ /* Clearfix applied to .row because row content is floated. */
412
+ .row { @extend .clearfix; }
413
+
414
+ /* Show and hide depending on screen size. */
415
+ @media (max-width: $breakpoint-small-screen) {
416
+ .show-on-large, .show-on-medium, .hide-on-small { display: none; }
417
+ }
418
+ @media (min-width: $breakpoint-small-screen) {
419
+ .hide-on-large, .show-on-medium, .show-on-small { display: none; }
420
+ }
421
+
422
+ /* IE8 does not support media queries */
423
+ .lt-ie9 .show-on-medium, .lt-ie9 .show-on-small { display: none; }
424
+
425
+ /* Contain floats: nicolasgallagher.com/micro-clearfix-hack/ */
426
+ .clearfix:before, .clearfix:after { content: ''; display: table; }
427
+ .clearfix:after { clear: both; }
428
+ .clearfix { zoom: 1; }
429
+
430
+ /* Utility classes: Hidden, float left, float right, etc. */
431
+ .hidden { display: none; }
432
+ .left { float: left; padding-right: $gutter; }
433
+ .right { float: right; padding-left: $gutter; }
434
+ .centered { text-align: center; }
435
+ .left-aligned {
436
+ text-align: left;
437
+ @media (max-width: $breakpoint-small-screen) {
438
+ text-align: center;
439
+ margin: $gutter 0;
440
+ }
441
+ }
442
+ .right-aligned {
443
+ text-align: right;
444
+ @media (max-width: $breakpoint-small-screen) {
445
+ text-align: center;
446
+ margin: $gutter 0;
447
+ }
448
+ }
449
+ .clear { clear: both; }
450
+ .clear-after { *zoom: 1; }
451
+ .clear-after:after { content: ''; display: table; clear: both; }
452
+
453
+ /* ==================
454
+ 5. Header
455
+ ================== */
456
+
457
+ #site-title {
458
+ display: block;
459
+ @extend .section-margins;
460
+ @extend .giga;
461
+ color: $text-color;
462
+ text-decoration: none;
463
+ }
464
+
465
+ #logo {
466
+ display: block;
467
+ margin: $gutter/2 auto;
468
+ img {
469
+ max-height: 180px;
470
+ }
471
+ }
472
+
473
+ /* ==================
474
+ 6. Navigation
475
+ =================== */
476
+
477
+ /* Main navigation with drop-down menu support */
478
+
479
+ @media (max-width: $breakpoint-small-screen) {
480
+ nav.left {
481
+ float: none;
482
+ display: block;
483
+ padding-right: 0;
484
+ width: 100%;
485
+ text-align: center;
486
+ }
487
+ }
488
+
489
+ nav ul {
490
+ margin: 0;
491
+ li {
492
+ display: inline-block;
493
+ position: relative;
494
+ padding: $gutter/2;
495
+ margin: 0;
496
+ &.first {
497
+ padding-left: 0;
498
+ }
499
+ &.last {
500
+ padding-right: 0;
501
+ }
502
+ }
503
+ ul {
504
+ display: none;
505
+ margin: 0;
506
+ position: absolute;
507
+ top: 100%;
508
+ left: -0.5 * $gutter;
509
+ background-color: lighten( $background-color, 15% );
510
+ border: 1px solid darken( $background-color, 15% );
511
+ -webkit-box-shadow: 0px 1px 1px 0px rgba(50, 50, 50, 0.2);
512
+ -moz-box-shadow: 0px 1px 1px 0px rgba(50, 50, 50, 0.2);
513
+ box-shadow: 0px 1px 1px 0px rgba(50, 50, 50, 0.2);
514
+ text-align: left;
515
+ z-index: 2;
516
+ li {
517
+ display: block;
518
+ padding: $gutter/3 $gutter;
519
+ &:first-child {
520
+ padding-top: $gutter;
521
+ }
522
+ &:last-child {
523
+ padding-bottom: $gutter;
524
+ }
525
+ }
526
+ }
527
+ }
528
+
529
+ /* CSS triangle at the top of drop-down menus. */
530
+ nav ul ul li:first-child a:after {
531
+ content: '';
532
+ position: absolute;
533
+ top: -6px;
534
+ left: 50%;
535
+ margin-left: -6px;
536
+ border-left: 6px solid transparent;
537
+ border-right: 6px solid transparent;
538
+ border-bottom: 6px solid lighten( $background-color, 15% );
539
+ z-index: 1;
540
+ }
541
+ /* Border for the CSS triangle at the top of drop-down menus. */
542
+ nav ul ul li:first-child a:before {
543
+ content: '';
544
+ position: absolute;
545
+ top: -7px;
546
+ left: 50%;
547
+ margin-left: -7px;
548
+ border-left: 7px solid transparent;
549
+ border-right: 7px solid transparent;
550
+ border-bottom: 7px solid darken( $background-color, 15% );
551
+ z-index: 0;
552
+ }
553
+
554
+ /* Revealing drop-down menus on hover */
555
+ nav li:hover ul { display: block; }
556
+
557
+ /* Styling active links. */
558
+ nav li.active > a { color: $link-color; }
559
+
560
+ /* =====================
561
+ 7. Tags
562
+ ===================== */
563
+
564
+ .tag {
565
+ @extend .button;
566
+ margin: 0 $gutter/3 $gutter/3 0;
567
+ padding: .2em .5em;
568
+ a {
569
+ text-decoration: none;
570
+ color: $text-color;
571
+ }
572
+ &.active {
573
+ background-color: $link-color;
574
+ border-color: $link-color;
575
+ a {
576
+ color: $background-color;
577
+ }
578
+ }
579
+ }
580
+
581
+ .subcategories, .blog-tags {
582
+ font-size: 0;
583
+ }
584
+
585
+ .subcategories > li, .blog-tags > li {
586
+ @extend .tag;
587
+ font-size: 0.85 * $base-font-size;
588
+ }
589
+
590
+
591
+ /* ==============
592
+ 8. Social
593
+ ============== */
594
+
595
+ .social-links a {
596
+ font-size: 1.4rem;
597
+ line-height: 2rem;
598
+ display: inline-block;
599
+ padding-right: $gutter/6;
600
+ text-decoration: none;
601
+ }
602
+
603
+ /* IE8 does not support SVG. */
604
+ .lt-ie9 .payment-types { display:none; }
605
+
606
+ /* ===========
607
+ 9. Blog
608
+ =========== */
609
+
610
+ /* Separating articles with a border on the blog landing page.*/
611
+ .template-blog .article {
612
+ border-bottom: darken( $background-color, 5%) 0.07rem solid;
613
+ padding: $gutter 0;
614
+ &.first {
615
+ padding-top: 0;
616
+ }
617
+ &.last {
618
+ border-bottom: none;
619
+ }
620
+ }
621
+
622
+ /* All blog images should stretch to the full width on small screens. */
623
+ @media (max-width: $breakpoint-small-screen) {
624
+ .template-article .article img {
625
+ display: block;
626
+ width: 100% !important;
627
+ float: none !important;
628
+ margin-top: $gutter/2 !important;
629
+ margin-bottom: $gutter/2 !important;
630
+ margin-left: auto !important;
631
+ margin-right: auto !important;
632
+ clear: both;
633
+ @extend .clear-after;
634
+ }
635
+ }
636
+
637
+ .date, .comment-date { @extend .zeta; }
638
+
639
+ .meta > span + span { padding-left: $gutter/2; }
640
+
641
+ /* Square element that contains the blog image, which is
642
+ set as a centered background image. */
643
+ .square-holder {
644
+ display: block;
645
+ background-position: center center;
646
+ background-repeat: no-repeat;
647
+ background-size: cover;
648
+ width: 100%;
649
+ height: 0;
650
+ padding-bottom: 100%;
651
+ }
652
+
653
+ /* Fading out content so that the height of the article excerpt
654
+ always matches the height of the blog image on the left. */
655
+ .fadeout-overflow-bottom {
656
+ position: relative;
657
+ height: 0;
658
+ padding-bottom: 33.33%;
659
+ overflow: hidden;
660
+ }
661
+ .fadeout-overflow-bottom:after {
662
+ content: "";
663
+ display: block;
664
+ position: absolute;
665
+ bottom: 0;
666
+ width: 100%;
667
+ height: 3 * $gutter;
668
+ background: linear-gradient(to top, rgba($background-color, 1) 0, rgba($background-color, 0) 100%);
669
+ pointer-events: none;
670
+ }
671
+
672
+ /* On small screens, we don't truncate content, and don't fade
673
+ it out since the blog image is full-width, and the excerpt
674
+ is below it. */
675
+ @media (max-width: $breakpoint-small-screen) {
676
+ .fadeout-overflow-bottom {
677
+ height: auto;
678
+ padding-bottom: 0;
679
+ }
680
+ .fadeout-overflow-bottom:after {
681
+ background: transparent;
682
+ }
683
+ }
684
+
685
+ .lt-ie9 .fadeout-overflow-bottom { height: auto; padding-bottom: 0; }
686
+
687
+ #comments { margin: 2 * $gutter 0; }
688
+
689
+ /* ==========================================================================
690
+ 10. Product and collection pages.
691
+ ========================================================================== */
692
+
693
+ .product-details > div,
694
+ .product-details > p {
695
+ @extend .section-margins;
696
+ }
697
+
698
+ .product-photo-container {
699
+ @extend .grid-margins;
700
+ }
701
+
702
+ /* Quickly hiding default variant drop-down when JavaScript is enabled */
703
+ /* See this: http://www.learningjquery.com/2008/10/1-way-to-avoid-the-flash-of-unstyled-content/ */
704
+ .js #product-select { display: none; }
705
+
706
+ /* Product option wrapper. */
707
+ .selector-wrapper {
708
+ @extend .paragraph-margins;
709
+ }
710
+
711
+ .sort-by {
712
+ margin-top: .25rem;
713
+ }
714
+
715
+ @media (max-width: $breakpoint-small-screen) {
716
+ .sort-by {
717
+ float: none;
718
+ margin-bottom: $gutter;
719
+ }
720
+ }
721
+
722
+ .prod-caption {
723
+ margin: $gutter/6 0;
724
+ }
725
+
726
+ .product-photo-thumb:nth-child(2n+1) {
727
+ clear: both;
728
+ }
729
+
730
+ @media (max-width: $breakpoint-small-screen) {
731
+ .two-per-row.product-photo-thumb {
732
+ width: 50% !important;
733
+ float: left !important;
734
+ }
735
+ }
736
+
737
+ /* ======================================
738
+ 11. Search form and search results
739
+ ====================================== */
740
+
741
+ /* Override to globally-hosted search.css on the /search page */
742
+ #searchresults {
743
+ @extend .paragraph-margins;
744
+ }
745
+ /* Styling all search forms. You can reuse this for newsletter signup form. */
746
+ .search-form {
747
+ display: inline-block;
748
+ margin-top: .2 * $base-font-size;
749
+ @extend .inline-collapse;
750
+ }
751
+ /* Hiding search form in header on small screens */
752
+ @media (max-width: $breakpoint-small-screen) {
753
+ header .search-form {
754
+ display: none;
755
+ }
756
+ }
757
+
758
+ /* =====================
759
+ 12. Footer
760
+ ===================== */
761
+
762
+ footer {
763
+ @extend .centered;
764
+ & > * {
765
+ @extend .paragraph-margins;
766
+ }
767
+ a + a { padding-left: 0.666 * $gutter; }
768
+ }