A Sass Naming Convention for Sass libraries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="button">An example link</a> | |
<a class="button--ghost">An example link</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.1) | |
// Compass (v1.0.1) | |
// ---- | |
// Sass: Typed value factory & validator using Map | |
// Direction type that accepts only top, right, left, bottom | |
// Direction type factory | |
@function dir-new($dir) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.1) | |
// Compass (v1.0.1) | |
// ---- | |
// Sass: Generating decoupled color schemes | |
// Helper functions | |
@function tint($color, $percentage) { | |
@return mix(white, $color, $percentage); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="button" href="#"><a> button</a> | |
<button class="button"><button> button</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="collection"> | |
<div class="collection__item">Item 1</div> | |
<div class="collection__item">Item 2</div> | |
<div class="collection__item">Item 3</div> | |
</div> | |
<ul class="collection"> | |
<li class="collection__item">Item 1</li> | |
<li class="collection__item">Item 2</li> | |
<li class="collection__item">Item 3</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.1) | |
// Compass (v1.0.1) | |
// ---- | |
// A property map | |
$properties: ( | |
prop-1: "raw-prop-1-value", | |
prop-2: "raw-prop-2-value" | |
); |
This is my best practices for WordPress but it is also the one FOR MOST OF THE WORDPRESSS DESIGNERS/DEVELOPERS. Some of these practices are useful to check code quality of themes/plugins.
You may/should break away from WordPress Coding Standards and follow PSR if you are not a core/core-plugin developer (If you haven't followed either of WordPress Conding Standards or PSR, it is a bad habit) .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is just an example FOR WORDPRESS USERS. | |
// | |
// To make this better: | |
// * use namespace/class/closure etc. | |
// * use autoloader | |
// * create & use service provider classes | |
// * create & use factory for WP_Query, WP_User etc. | |
// interface ContainerInterface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface AccountInterface | |
{ | |
public function getBalance(); | |
public function increase($money); | |
public function decrease($money); | |
} | |
trait AccountTrait | |
{ |