@@ -212,7 +212,7 @@ border-box-html()
212212 html
213213 box-sizing : border-box
214214
215- * ,
215+ * ,
216216 * :before ,
217217 * :after
218218 box-sizing : inherit
@@ -426,3 +426,49 @@ cache-images()
426426 body :after
427427 display : none
428428 content : background-images
429+
430+ // Mixin: Rem Calculator
431+ //
432+ // Calculates and returns the rem value based on px input. Default base font
433+ // size is 16px, but can be changed with base-font-size.
434+ //
435+ // ex : rem(30px) or rem(30)
436+ // returns : 1.875rem
437+
438+ rem (value )
439+ base-font-size ?= 16px
440+ type = unit (value )
441+ if type == px
442+ return unit (value / base-font-size , 'rem' )
443+ else
444+ return unit (value , type )
445+
446+ // Block Mixin: Quantity Queries
447+ //
448+ // Set rules for a selector based on a specific sibling count.
449+ // via: https://github.com/pascalduez/postcss-quantity-queries
450+ //
451+ // ex. +quantity-at-least(6)
452+ // ex. +quantity-at-most(12, div)
453+ // ex. +quantity-between(0, 8, span)
454+ // ex. +quantity-exactly(5)
455+
456+ quantity-at-least (count = 4 , selector = li )
457+ & > {selector}:nth-last-child (n + { count } )
458+ & > {selector}:nth-last-child (n + { count } ) ~ { selector }
459+ { block }
460+
461+ quantity-at-most (count = 4 , selector = li )
462+ & > {selector}:nth-last-child (- n + { count } ):first-child
463+ & > {selector}:nth-last-child (- n + { count } ):first-child ~ { selector }
464+ { block }
465+
466+ quantity-between (start = 0 , end = 10 , selector = li )
467+ & > {selector}:nth-last-child (n + { start } ):nth-last-child (- n + { end } ):first-child
468+ & > {selector}:nth-last-child (n + { start } ):nth-last-child (- n + { end } ):first-child ~ { selector }
469+ { block }
470+
471+ quantity-exactly (count = 4 , selector = li )
472+ & > {selector}:nth-last-child ({ count } ):first-child
473+ & > {selector}:nth-last-child ({ count } ):first-child ~ { selector }
474+ { block }
0 commit comments