Skip to content
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

Use .content-only body class. #402

Open
gjb2048 opened this issue Dec 18, 2015 · 1 comment
Open

Use .content-only body class. #402

gjb2048 opened this issue Dec 18, 2015 · 1 comment

Comments

@gjb2048
Copy link
Collaborator

gjb2048 commented Dec 18, 2015

Hi Bas,

I'm improving Shoehorn and noticed a new 'content-only' class that gets added by M3.0 when docking etc. and no blocks are shown on the page, thus this is possible in less/moodle/core.less:

/*
.dir-ltr.editing.used-region-side-post.used-region-side-pre {
    #region-main {
        .make-sm-column(6);
        .make-lg-column(8);
        .make-sm-column-push(3);
        .make-lg-column-push(2);
    }
    #block-region-side-post {
        .make-sm-column(3);
        .make-lg-column(2);
        min-height: 100px;
    }
    #block-region-side-pre {
        .make-sm-column(3);
        .make-lg-column(2);
        .make-sm-column-pull(6);
        .make-lg-column-pull(8);
        min-height: 100px;
    }
}

.dir-rtl.editing.used-region-side-post.used-region-side-pre {
    #region-main {
        .make-sm-column(6);
        .make-lg-column(8);
        .make-sm-column-push(3);
        .make-lg-column-push(2);
    }
    #block-region-side-pre {
        .make-sm-column(3);
        .make-lg-column(2);
        .make-sm-column-push(3);
        .make-lg-column-push(2);
        min-height: 100px;
    }
    #block-region-side-post {
        .make-sm-column(3);
        .make-lg-column(2);
        .make-sm-column-pull(9);
        .make-lg-column-pull(10);
        min-height: 100px;
    }
}

.has_dock {
    &.empty-region-side-pre #region-main, &.empty-region-side-post #region-main {
        .make-sm-column(12);
        .make-lg-column(12);
        .make-sm-column-push(0);
        .make-lg-column-push(0);
    }

    &.empty-region-side-pre.used-region-side-post #region-main,
    &.empty-region-side-post.used-region-side-pre #region-main {
        .make-sm-column(9);
        .make-lg-column(10);
    }

    &.empty-region-side-pre #block-region-side-pre {
        display: none;
    }

    &.empty-region-side-post #block-region-side-post {
        display: none;
    }
}

.has_dock.dir-ltr {
    &.empty-region-side-pre.used-region-side-post #region-main {
        .make-sm-column-push(0);
        .make-lg-column-push(0);
    }

    &.empty-region-side-post.used-region-side-pre #region-main {
        .make-sm-column-push(3);
        .make-lg-column-push(2);
    }

    &.empty-region-side-post.used-region-side-pre #block-region-side-pre {
        .make-sm-column-pull(9);
        .make-lg-column-pull(10);
    }
}

.has_dock.dir-rtl {
    &.empty-region-side-pre.used-region-side-post #region-main {
        .make-sm-column-push(3);
        .make-lg-column-push(2);
    }

    &.empty-region-side-post.used-region-side-pre #region-main {
        .make-sm-column-push(0);
        .make-lg-column-push(0);
    }

    // Negate the push applied when transitioning from three columns.
    // LTR does not have this vice-versa issue as no 'push' for post.
    &.empty-region-side-post.used-region-side-pre #block-region-side-pre {
        .make-sm-column-push(0);
        .make-lg-column-push(0);
    }

    &.empty-region-side-pre.used-region-side-post #block-region-side-post {
        .make-sm-column-pull(9);
        .make-lg-column-pull(10);
    }
}
*/

.content-only {
    #region-main {
        width: 100%;
    }
    &.dir-rtl #region-main.col-lg-push-2 {
        right: 0;
    }
}

Commented code for visual explanation.

Not fully tested yet. But I wanted to document what I'd found. And get your thoughts on the matter.

Cheers,

G

@gjb2048
Copy link
Collaborator Author

gjb2048 commented Oct 3, 2024

Closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant