Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Snippets] Added spacing util class for scss plugin #211 #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Mathys-Gasnier merged 1 commit into quicksnip-dev:main from dinesh-here:feature/sass-spacing
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions snippets/scss/utilities/spacing.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Spacing
description: This SCSS snippet dynamically generates utility classes for managing spacing in a consistent and efficient manner. The classes are built using a loop, ensuring scalability and flexibility. use .mt-* for margin-top, and .pb-* for padding bottom
author: dinesh-here
tags: clearfix,utility,css, spacing
---

```scss
$step: 5;
$start_limit: 0;
$end_limit: 50;

@while $start_limit <= $end_limit {
.mt-#{$start_limit} {
margin-top: $start_limit + px;
}
.mb-#{$start_limit} {
margin-bottom: $start_limit + px;
}

.ml-#{$start_limit} {
margin-left: $start_limit + px;
}

.mr-#{$start_limit} {
margin-right: $start_limit + px;
}

.pt-#{$start_limit} {
padding-top: $start_limit + px;
}
.pb-#{$start_limit} {
padding-bottom: $start_limit + px;
}

.pl-#{$start_limit} {
padding-left: $start_limit + px;
}

.pr-#{$start_limit} {
padding-right: $start_limit + px;
}
.mx-#{$start_limit} {
margin-left: $start_limit + px;
margin-right: $start_limit + px;
}

.px-#{$start_limit} {
padding-left: $start_limit + px;
padding-right: $start_limit + px;
}

.my-#{$start_limit} {
margin-top: $start_limit + px;
margin-bottom: $start_limit + px;
}

.py-#{$start_limit} {
padding-top: $start_limit + px;
padding-bottom: $start_limit + px;
}


$start_limit: $start_limit + $step;
}

```
Loading

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /