Last active
April 24, 2020 14:52
-
-
Save vanderb/dc555c4dd75328384ff36fc3d92aa5a8 to your computer and use it in GitHub Desktop.
MJML Spacer-Classes with PHP & Laravel-Blade
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
@foreach([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100] as $space) | |
@foreach(["top", "bottom", "left", "right"] as $side) | |
<mj-class name="p{{ substr($side, 0, 1) }}-{{ $space }}" padding-{{ $side }}="{{ $space }}px"/> | |
@endforeach | |
@endforeach |
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 | |
<?php | |
foreach([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100] as $space) : | |
foreach(["top", "bottom", "left", "right"] as $side) : | |
echo sprintf('<mj-class name="p%3$s-%1$d" padding-%2$s="%1$dpx"/>', $space, $side, substr($side, 0, 1)); | |
endforeach; | |
endforeach; | |
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
// padding-top: 5 | |
<mj-section mj-class="pt-5">...</mj-section> | |
// padding-right: 10 | |
<mj-section mj-class="pr-10">...</mj-section> | |
// padding-bottom: 25 | |
<mj-section mj-class="pb-25">...</mj-section> | |
// padding-left: 100 | |
<mj-section mj-class="pl-100">...</mj-section> | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment