Skip to content

Instantly share code, notes, and snippets.

@kievsash
Created October 19, 2023 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kievsash/4c0be8256a44d42bc3b21a39877f1c9c to your computer and use it in GitHub Desktop.
Save kievsash/4c0be8256a44d42bc3b21a39877f1c9c to your computer and use it in GitHub Desktop.
[scss] generate padding classes to be able to assign it for each td (row, column): tr-1-td-3-p0
// https://www.sassmeister.com/ - playground
@for $tr from 1 through 30 {
@for $td from 1 to 30 {
.tr-#{$tr}-td-#{$td}-p0 tr:nth-child(#{$tr}) td:nth-child(#{$td}) {
padding: 0;
}
}
}
/*
generate classes
.tr-1-td-1-p-0 tr:nth-child(1) td:nth-child(1) {
padding: 0;
}
.tr-1-td-2-p-0 tr:nth-child(1) td:nth-child(2) {
padding: 0;
}
etc
for table
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment