Changeset 1651472
- Timestamp:
- 05/05/2017 08:22:19 AM (9 years ago)
- Location:
- cxx-margin-and-padding-utility/tags/2.0.0
- Files:
-
- 13 added
- 3 edited
- 2 copied
-
. (copied) (copied from cxx-margin-and-padding-utility/trunk)
-
_scss (added)
-
_scss/_base.scss (added)
-
_scss/_children.scss (added)
-
_scss/_responsive.scss (added)
-
_scss/inc (added)
-
_scss/inc/_flex.scss (added)
-
_scss/inc/_variables.scss (added)
-
css-margin-padding-util.php (modified) (1 diff)
-
css-margin-padding-v2.css (copied) (copied from cxx-margin-and-padding-utility/trunk/css-margin-padding-v2.css)
-
css-margin-padding-v2.css.map (added)
-
css-margin-padding-v2.scss (added)
-
css/css-margin-padding-v2.css (added)
-
css/css-margin-padding-v2.css.map (added)
-
readme.txt (modified) (10 diffs)
-
scss/css-margin-padding-util-scss.css (added)
-
scss/css-margin-padding-util-scss.css.map (added)
-
scss/css-margin-padding-util-scss.scss (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cxx-margin-and-padding-utility/tags/2.0.0/css-margin-padding-util.php
r1555520 r1651472 1 1 <?php 2 3 2 /* 4 5 3 Plugin Name: CSS Margins and Padding util 6 7 4 Description: Utility for adding css classes for Margin and Padding e.g. .man for 0 margin on all sides, .ptm for 1em padding-top. 8 9 Version: 1.2.2 10 5 Version: 2.0.0 11 6 Author: Jakob op den Brouw 12 13 7 Author URI: http://connexxions.me 14 15 8 */ 16 9 17 10 /** 11 * Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript 12 */ 13 add_action( 'wp_enqueue_scripts', 'cxx_margins_padding_util', 99 ); 18 14 19 15 /** 20 21 * Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript 22 16 * Enqueue all the util css 23 17 */ 24 25 add_action( 'wp_enqueue_scripts', 'cxx_margins_padding_util', 99 );26 27 28 29 /**30 31 * Enqueue all the util css32 33 */34 35 18 function cxx_margins_padding_util() { 36 37 19 // Respects SSL, css-margin-padding-util.css is relative to the current file 38 39 wp_register_style( 'cxx-margin-padding-util', plugins_url('/css/css-margin-padding-util-scss.css', __FILE__) ); 40 41 wp_register_style( 'cxx-margin-padding-last-util', plugins_url('/css/css-margin-padding-last-util.css', __FILE__) ); 42 43 wp_register_style( 'cxx-margin-padding-first-util', plugins_url('/css/css-margin-padding-first-util.css', __FILE__) ); 44 45 wp_register_style( 'cxx-margin-padding-responsive-util', plugins_url('/css/css-margin-padding-responsive-util.css', __FILE__) ); 46 20 wp_register_style( 'cxx-margin-padding-v2', plugins_url('/css-margin-padding-v2.css', __FILE__) ); 47 21 wp_register_style( 'cxx-boxshadow-util', plugins_url('/css/css-boxshadow-util.css', __FILE__) ); 22 wp_register_style( 'cxx-flexbox-util', plugins_url('/css/css-flexbox-util.css', __FILE__) ); 48 23 49 wp_register_style( 'cxx-flexbox-util', plugins_url('/css/css-flexbox-util.css', __FILE__) ); 50 51 52 53 54 wp_enqueue_style( 'cxx-margin-padding-util' ); 55 56 wp_enqueue_style( 'cxx-margin-padding-last-util' ); 57 58 wp_enqueue_style( 'cxx-margin-padding-first-util' ); 59 60 wp_enqueue_style( 'cxx-margin-padding-responsive-util' ); 61 24 wp_enqueue_style( 'cxx-margin-padding-v2' ); 62 25 wp_enqueue_style( 'cxx-boxshadow-util' ); 63 64 26 wp_enqueue_style( 'cxx-flexbox-util' ); 65 66 27 } -
cxx-margin-and-padding-utility/tags/2.0.0/readme.txt
r1555525 r1651472 1 1 === CSS Margin & Padding Utility === 2 3 2 Contributors: Jakob op den Brouw 4 5 3 Tags: css, margin, padding, boxshadow, utility, css classes 6 7 4 Requires at least: 3.0.1 8 9 Tested up to: 4.6.1 10 11 Stable tag: 1.2.2 12 5 Tested up to: 4.7.4 6 Stable tag: 2.0.0 13 7 License: GPLv2 or later 14 15 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 16 17 18 9 19 10 Utility for adding css classes for Margin and Padding e.g. .man for 0 margin on all sides, .ptm for 1em padding-top. 20 11 21 22 23 12 == Description == 24 25 26 13 27 14 This utility plugin adds a series of css classes that allow easy addition of set padding and margin to any element. 28 15 29 30 31 16 For basic use, the classes follow the format of [margin / padding][location letter: all, top, right, bottom, left, vertical, horizontal][amount: none, small, medium, large, extra large (0.5em, 1em, 2em, 4em)] 32 17 33 34 35 18 Also in the basic classes are percentages, taking the place of the last letter in the format [p][percentage] e.g. p7-5 for 7.5% or p15 for 15%. 36 37 38 19 39 20 *Examples of Basic Classes:* … … 43 24 * mvp5 > margin vertical 5% = margin: 5% 0; 44 25 26 **Additional utility classes - First / Last child, Child / Sub** 45 27 46 47 **Additional utility classes - First / Last child** 48 49 To add selective classes for adding margin / padding to the first / last child of the required element, simply add 'last-' or 'first-' to the basic classes. 50 51 28 To add selective classes for adding margin / padding to the first / last child, any child, or any sub-element of the required element, simply add 'last-', 'first-', 'child-', or 'sub-' to the beginning of the basic classes. 52 29 53 30 *Examples of Child Classes* 54 31 55 * last-mhxl > last-child margin horizontal extra large = last-mhxl :last-child margin: 0 4em;56 * last-pbn > last-child padding bottom none = last-pbn :last-child padding-bottom: 0;57 * first-mtm > first-child margin top medium = first-mtm :first-child margin-top: 2em;58 59 32 * last-mhxl > last-child margin horizontal extra large = last-mhxl :last-child { margin: 0 4em; } 33 * last-pbn > last-child padding bottom none = last-pbn :last-child { padding-bottom: 0; } 34 * first-mtm > first-child margin top medium = first-mtm :first-child { margin-top: 2em; } 35 * child-mal > child margin all large = child-mal > * { margin: 4em; } 36 * sub-php5 > sub elements padding horizontal 5 percent = sub-php5 * { padding: 0 5%; } 60 37 61 38 **Additional utility classes - Responsive margin / padding** 62 39 63 40 You can also apply the margin / padding required to certain screen widths, ranging from xl (min: 1200px) to xs (max: 480px). To use these responsive classes, add -[screen-size] to the end of the basic classes. 64 65 66 41 67 42 *Examples of Responsive Classes* … … 71 46 * mhp15-md > margin horizontal 15%, medium screen = (max-width: 979px) and (min-width: 768px) margin-left: 15%; margin-right: 15%; 72 47 73 74 75 48 **Full Table of Options** 76 49 … … 79 52 p = padding 80 53 81 [location letter]54 [location] 82 55 a = all 83 56 t = top … … 88 61 h = horizontal (left + right) 89 62 90 [amount letter]63 [amount] 91 64 s = small (0.5em) 92 65 m = medium (1.0em) … … 99 72 p15 = 15 percent (15.0%) 100 73 101 [first / last] 102 first- = :first-child103 last- = :last-child74 [first / last] (prefix) 75 first- = > :first-child 76 last- = > :last-child 104 77 105 [screen-size] 78 [child / sub] (prefix) 79 child- = > * 80 sub- = * 81 82 [screen-size] (suffix) 106 83 -xs = max-width: 480px 107 84 -sm = max-width: 767px and min-width: 481px … … 110 87 -xl = min-width: 1200px 111 88 112 113 114 89 **Additional utility classes - Boxshadow** 115 90 116 91 Using the boxshadow utility classes, you can quickly add a boxshadow to divs and other elements. The format of the utility classes is as follows: shadowout-[direction][blur]-[shadow opacity]. 117 118 119 92 120 93 *Examples of Boxshadow* … … 122 95 * shadowout-nm-medium > no direction, medium blur, medium opacity = box-shadow: 0 0 .15em 0 rgba(0,0,0,0.27); 123 96 * shadowout-brm-dark > bottom-right direction, medium blur, dark opacity = box-shadow: .15em .15em .3em 0 rgba(0,0,0,0.54); 124 125 126 97 127 98 *Options for Boxshadow utility* … … 149 120 -dark = dark (0.54 opacity) 150 121 151 152 153 122 == Installation == 154 155 156 123 157 124 Installation: 158 125 159 160 161 126 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly. 162 163 127 2. Activate the plugin through the 'Plugins' screen in WordPress. 164 165 128 3. Use the classes (examples given above) to easily and quickly add padding and margin to any element. 166 129 130 == Changelog == 167 131 132 = 2.0.0 = 168 133 169 == Changelog == 134 * Extensive use of scss to clean up css files and compile down to one css include for all margin and padding utils 135 136 * Addition of child- and sub- selectors for margin and padding util 137 138 * Bugfix: changing implementation of first- and last- to only affect immediate descendants 170 139 171 140 = 1.2.2 = … … 206 175 == Upgrade Notice == 207 176 177 = 2.0.0 = 178 179 * Addition of child- and sub- selectors for > * and * respectively 180 181 * first- and last- are only applied to direct children ( > :first-child or > :last-child ) 182 208 183 = 1.1 = 209 184 -
cxx-margin-and-padding-utility/tags/2.0.0/scss/css-margin-padding-util-scss.scss
r1542886 r1651472 18 18 (p, padding); 19 19 20 $direction-list: 20 $direction-list: 21 21 (a, all), 22 22 (v, vertical),
Note: See TracChangeset
for help on using the changeset viewer.