Skip to content

Instantly share code, notes, and snippets.

@almonk
Created April 25, 2017 17:38
Show Gist options
  • Save almonk/e6f00b3b4d98bbed19b31642d3fb7f8e to your computer and use it in GitHub Desktop.
Save almonk/e6f00b3b4d98bbed19b31642d3fb7f8e to your computer and use it in GitHub Desktop.
Auto specific spacing class
package main
import "fmt"
func main() {
// Padding
sum := 1
maxSize := 10
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pa--%d { padding: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pl--%d { padding-left: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pr--%d { padding-right: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pb--%d { padding-bottom: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pt--%d { padding-top: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".pv--%d { padding-top: %dpx; padding-bottom: %dpx }", sum, sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".ph--%d { padding-left: %dpx; padding-right: %dpx }", sum, sum, sum)
fmt.Println(property)
sum++
}
sum = 1
// Margins
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".ma--%d { margin: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".ml--%d { margin-left: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".mr--%d { margin-right: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".mb--%d { margin-bottom: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".mt--%d { margin-top: %dpx }", sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".mv--%d { margin-top: %dpx; margin-bottom: %dpx }", sum, sum, sum)
fmt.Println(property)
sum++
}
sum = 1
for i := 0; i < maxSize; i++ {
property := fmt.Sprintf(".mh--%d { margin-left: %dpx; margin-right: %dpx }", sum, sum, sum)
fmt.Println(property)
sum++
}
sum = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment