Skip to content

Commit

Permalink
Re-organize SASS structure (#1425)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismail-elkorchi committed May 10, 2020
1 parent 27fc314 commit 5c74dc9
Show file tree
Hide file tree
Showing 52 changed files with 538 additions and 512 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@
/vendor
package-lock.json
composer.lock
style.css.map
style.css.map
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ My ultra-minimal CSS might make me look like theme tartare but that means less s
* Custom template tags in `inc/template-tags.php` that keep your templates clean and neat and prevent code duplication.
* Some small tweaks in `inc/template-functions.php` that can improve your theming experience.
* A script at `js/navigation.js` that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in `functions.php`.
* 2 sample layouts in `sass/layout/` made using CSS Grid for a sidebar on either side of your content. Just uncomment the layout of your choice in `sass/site/_site.scss`.
* 2 sample layouts in `sass/layouts/` made using CSS Grid for a sidebar on either side of your content. Just uncomment the layout of your choice in `sass/style.scss`.
Note: `.no-sidebar` styles are automatically loaded.
* Smartly organized starter CSS in `style.css` that will help you to quickly get your design off the ground.
* Full support for `WooCommerce plugin` integration with hooks in `inc/woocommerce.php`, styling override woocommerce.css with product gallery features (zoom, swipe, lightbox) enabled.
Expand Down
5 changes: 5 additions & 0 deletions sass/abstracts/_abstracts.scss
@@ -0,0 +1,5 @@
@import "variables/colors";
@import "variables/typography";
@import "variables/structure";
@import "variables/columns";
@import "mixins/mixins";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions sass/base/_base.scss
@@ -0,0 +1,20 @@
/* Typography
--------------------------------------------- */
@import "typography/typography";

/* Elements
--------------------------------------------- */
@import "elements/body";
@import "elements/hr";
@import "elements/lists";
@import "elements/media";
@import "elements/tables";

/* Links
--------------------------------------------- */
@import "elements/links";

/* Forms
--------------------------------------------- */
@import "elements/buttons";
@import "elements/fields";
3 changes: 3 additions & 0 deletions sass/base/elements/_body.scss
@@ -0,0 +1,3 @@
body {
background: $color__background-body; // Fallback for when there is no custom background color defined.
}
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions sass/base/elements/_hr.scss
@@ -0,0 +1,6 @@
hr {
background-color: $color__background-hr;
border: 0;
height: 1px;
margin-bottom: 1.5em;
}
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions sass/base/elements/_media.scss
@@ -0,0 +1,15 @@
/* Make sure embeds and iframes fit their containers. */
embed,
iframe,
object {
max-width: 100%;
}

img {
height: auto; // Make sure images are scaled correctly.
max-width: 100%; // Adhere to container width.
}

figure {
margin: 1em 0; // Extra wide images within figure tags don't overflow the content area.
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions sass/components/_components.scss
@@ -0,0 +1,27 @@
/* Navigation
--------------------------------------------- */
@import "navigation/navigation";

/* Posts and pages
--------------------------------------------- */
@import "content/posts-and-pages";

/* Comments
--------------------------------------------- */
@import "comments/comments";

/* Widgets
--------------------------------------------- */
@import "widgets/widgets";

/* Media
--------------------------------------------- */
@import "media/media";

/* Captions
--------------------------------------------- */
@import "media/captions";

/* Galleries
--------------------------------------------- */
@import "media/galleries";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions sass/components/media/_media.scss
@@ -0,0 +1,13 @@
.page-content .wp-smiley,
.entry-content .wp-smiley,
.comment-content .wp-smiley {
border: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}

/* Make sure logo link wraps around logo image. */
.custom-logo-link {
display: inline-block;
}
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions sass/elements/_elements.scss

This file was deleted.

2 changes: 0 additions & 2 deletions sass/forms/_forms.scss

This file was deleted.

11 changes: 11 additions & 0 deletions sass/generic/_box-sizing.scss
@@ -0,0 +1,11 @@
/* Inherit box-sizing to more easily change it's value on a component level.
@link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
*,
*::before,
*::after {
box-sizing: inherit;
}

html {
box-sizing: border-box;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 0 additions & 30 deletions sass/media/_media.scss

This file was deleted.

9 changes: 0 additions & 9 deletions sass/navigation/_navigation.scss

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions sass/site/_site.scss

This file was deleted.

102 changes: 51 additions & 51 deletions sass/style.scss
Expand Up @@ -23,78 +23,78 @@ Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/
/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Normalize
# Typography
# Elements
# Forms
# Navigation
## Links
## Menus
# Accessibility
# Alignments
# Widgets
# Content
## Posts and pages
## Comments
# Infinite scroll
# Media
## Captions
## Galleries
--------------------------------------------------------------*/
@import "variables-site/variables-site";
@import "mixins/mixins-master";
# Generic
- Normalize
- Box sizing
# Base
- Typography
- Elements
- Links
- Forms
## Layouts
# Components
- Navigation
- Posts and pages
- Comments
- Widgets
- Media
- Captions
- Galleries
# plugins
- Jetpack infinite scroll
# Utilities
- Accessibility
- Alignments
/*--------------------------------------------------------------
# Normalize
--------------------------------------------------------------*/
@import "normalize";

/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/
@import "typography/typography";
// Import variables and mixins.
@import "abstracts/abstracts";

/*--------------------------------------------------------------
# Elements
# Generic
--------------------------------------------------------------*/
@import "elements/elements";

/*--------------------------------------------------------------
# Forms
--------------------------------------------------------------*/
@import "forms/forms";
/* Normalize
--------------------------------------------- */
@import "generic/normalize";

/*--------------------------------------------------------------
# Navigation
--------------------------------------------------------------*/
@import "navigation/navigation";
/* Box sizing
--------------------------------------------- */
@import "generic/box-sizing";

/*--------------------------------------------------------------
# Accessibility
# Base
--------------------------------------------------------------*/
@import "modules/accessibility";
@import "base/base";

/*--------------------------------------------------------------
# Alignments
# Layouts
--------------------------------------------------------------*/
@import "modules/alignments";
// @import "layouts/content-sidebar"; // Uncomment this line for a sidebar on right side of your content.
// @import "layouts/sidebar-content"; // Uncomment this line for a sidebar on left side of your content.

/*--------------------------------------------------------------
# Widgets
# Components
--------------------------------------------------------------*/
@import "site/secondary/widgets";
@import "components/components";

/*--------------------------------------------------------------
# Content
# Plugins
--------------------------------------------------------------*/
@import "site/site";

/*--------------------------------------------------------------
# Infinite scroll
--------------------------------------------------------------*/
@import "modules/infinite-scroll";
/* Jetpack infinite scroll
--------------------------------------------- */
@import "plugins/jetpack/infinite-scroll";

/*--------------------------------------------------------------
# Media
# Utilities
--------------------------------------------------------------*/
@import "media/media";

/* Accessibility
--------------------------------------------- */
@import "utilities/accessibility";

/* Alignments
--------------------------------------------- */
@import "utilities/alignments";
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions sass/variables-site/_variables-site.scss

This file was deleted.

17 changes: 8 additions & 9 deletions sass/woocommerce.scss
Expand Up @@ -9,36 +9,35 @@ $woocommerce__color-error: #e2401c;
$woocommerce__color-success: #0f834d;
$woocommerce__color-info: #3d9cd2;

// Imports
@import "variables-site/variables-site";
@import "mixins/mixins-master";
// Import variables and mixins
@import "abstracts/abstracts";

/**
* Shop tables
*/
@import "shop/tables";
@import "plugins/woocommerce/tables";

/**
* Products
*/
@import "shop/products";
@import "plugins/woocommerce/products";

/**
* Single product
*/
@import "shop/single-product";
@import "plugins/woocommerce/single-product";

/**
* Checkout
*/
@import "shop/checkout";
@import "plugins/woocommerce/checkout";

/**
* General WooCommerce components
*/
@import "shop/components";
@import "plugins/woocommerce/components";

/**
* WooCommerce widgets
*/
@import "shop/widgets";
@import "plugins/woocommerce/widgets";

0 comments on commit 5c74dc9

Please sign in to comment.