Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !13426

Reducing redundancy in output of the semantic grid columns system

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/dschenk/master into master Apr 25, 2014
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: dschenk

I often have the following use case when generating semantic columns:

.module {
  .make-xs-column(12);
  .make-sm-column(6);
  .make-md-column(3);
}

Meaning I need a class that fills a variable amount of columns, depending on breakpoints. Before this patch, the code above would generate the following CSS:

.module {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
  float: left;
  width: 100%;
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .module {
    float: left;
    width: 50%;
  }
}

[etc. for the other media-queries]

I propose to use the grid system in the following way to reduce this redundancy:

.module {
  .make-column();
  .make-xs-column(12);
  .make-sm-column(6);
  .make-md-column(3);
}

or:

.module {
  .make-column();
  .make-md-column(3);
}

This means using the make-column mixin whenever we want to define a semantic column class. In my opinion this disadvantage beats redundant output though.

Your thoughts?

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/dschenk/master