Jump to content

How to "less-ify" properly ?


johndoedelavegas

Recommended Posts

Hi,
I am new using Less, and I am wondering what the proper way to transform this css classes into less classes in order to reuse them.
.body-404 #content-wrapper, .page-404 {
    background: transparent !important;
}

    .page-404 .error-code {
        color: #f4b04f;
    }

.body-500 #content-wrapper, .page-500 {
    background: transparent !important;
}

    .page-500 .error-code {
        color: #e66454;
    }
2 Questions : 1/ Let's say one day I'll have a 403-error. Should it be one function that generate the class:
.mynewerror(403)
2/ And if yes or not, how it should be ?And same with this example:
.left-buffer-5 {
    margin-left: 5px;
}

.left-buffer-10 {
    margin-left: 10px;
}

.top-buffer-5 {
    margin-top: 5px;
}

.top-buffer-10 {
    margin-top: 10px;
}

.right-buffer-5 {
    margin-right: 5px;
}

.right-buffer-10 {
    margin-right: 10px;
}

I understand the mere principles of Less, but I have trouble to organize it and apply the DRY rule.

Thanks,

Stéphane.
Edited by johndoedelavegas
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...