Skip to content

Instantly share code, notes, and snippets.

@angellromero
angellromero / flexgrid.less
Created October 5, 2016 20:20
Flex Grid Mixin
// Uses Flexbox to create grid with container's direct descendant elements
.flex-grid(@columns: 2, @margin: @indent-md) {
@total-margin: (@columns - 1) * @margin;
@first-column-offset: @columns + 1;
.flex();
.flex-wrap(wrap);
> * {
@angellromero
angellromero / owl.carousel.random.js
Created September 20, 2016 19:58
A Random Plugin for Owl Carousel
@angellromero
angellromero / expires-headers.txt
Created September 12, 2016 16:03
Expires headers
# ----------------------------------------------------------------------
# | Expires headers |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
@angellromero
angellromero / less-format.less
Created September 2, 2016 01:25
General/M2 Less Formatting/Content Structure
//
// Magento_Review
// --------------------------------------------------
//
// Variables
// ------------------------------------------
@helpful-variable-margin: 10px 0 40px 0;
@angellromero
angellromero / mixins.less
Created January 7, 2016 19:08
Missing Mixins
// Triangles and arrows
.triangle-props {
content: "";
display: block;
position: absolute;
}
.triangle-upper-left(@size; @color) {
border-color: @color transparent transparent @color;
border-style: solid;
border-width: @size @size 0 1px;
@angellromero
angellromero / asc-option.html
Created September 16, 2015 15:04
Converting ASC/DESC to a Select Menu
<?php if($_key == 'name'): ?>
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key) && ($this->getCurrentDirection() == 'asc')): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__("%s (A-Z)",$_order) ?>
</option>
<option value="<?php echo $this->getOrderUrl($_key, 'desc') ?>"<?php if($this->isOrderCurrent($_key) && ($this->getCurrentDirection() == 'desc')): ?> selected="selected"<?php endif; ?>>
<?php echo $this->__("%s (Z-A)",$_order) ?>
</option>
<?php endif;?>
.hidden-sm,
.hidden-md,
.hidden-lg {
.show;
}
.hidden-sm {
@media (max-width: @screen-sm) {
.hide;
}
/*
* Improves jQuery:contains to become case-insensitive
* */
window.jQuery.expr[':'].Contains = function(a, i, m) {
return window.jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
(function($) {
@angellromero
angellromero / qty-toggle.html
Last active March 23, 2023 11:37
Quantity Toggle Increment/Decrement FunctionalityDescription Needed
<div class="qty-box qty-toggle">
<span class="label"><?php echo $this->__('Quantity');?></span>
<div class="inner">
<button class="button minus decrement" type="button"><i class="icon-minus"></i></button>
<input type="number" name="qty" id="qty" maxlength="12" value="<?php echo ($_product->getQty()*1) ?>" title="<?php echo $this->__('Qty') ?>" placeholder="QTY" class="input-text qty" />
<button class="button plus increment" type="button"><i class="icon-plus"></i></button>
</div>
</div>
@angellromero
angellromero / owl-carousel.less
Last active November 23, 2015 15:18
Owl Carousel