Skip to content

eLearning@UA - QoL fixes & other random things by nightershadow

Imported from https://raw.githubusercontent.com/uso-archive/data/flomaster/data/usercss/165268.user.css

Screenshot of eLearning@UA - QoL fixes & other random things

Details

Authornightershadow

LicenseCC-BY-NC-SA-4.0

Categoryelearning.ua.pt

Created

Updated

Code size19 kB

Code checksumf5c6218c

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

UPDATE NOTICE - 2022-02-20
As of today, 20th February 2022, this style is currently OUTDATED. The present content is just a mirror of what was in the userstyles website. Around 2020 and 2021, the Moodle version got upgraded. While quite a few changes still work (from minor testing), a full overhaul (mainly reworking specifiers and some of the annoying bugs got fixed, and others popped up) is currently postponed, but is expected some time around April-May, depending on how much time it takes. If you have any suggestions or you have a specific thing you want fixed, contact me through my GitLab account and I'll take a look at it.

Previous Description:
As the name implies, changes that will make using eLearning easier, along with some random things I think of along the way.

Most notable changes are improved layouts as well as links more distinguishable from text.

Made with some free time™ by a former LEI student.

Notes

Versioning scheme: <Year>.<Month>.<Version>[.Patch]

Version 18.10.1 - Release

Version 18.11.2 - Responsiveness Improvements.
Now each UC should display properly on User's Panel

Version 18.11.2b - Browser compability

Version 18.11.2c - Increased min-height of UC's wells + small description also wraps into an ellipsis.
Should prevent weird behaviour when description is too long.

Version 19.07.2a - Updated code to match beautifier settings.

Version 19.07.4 - DISPLAY OF UCS FINALLY FIXED!
This is such a good result that it bumps 2 versions!

  • Using Bootstrap's resets across all used spans.
  • Removed overflow being hidden by default on .media.body since it's unnecessary + will create weird rendering issues with flexbox use.
  • Shortened the mininum height of .course-info-container > .text-mute.
  • Made display on resolutions of <768px in width to be 1 column. This alows us to take advantage of the mobile layout for <576px, where the sidebar doesn't appear, while still transition with the sidebar appearing on sizes >=576px and <768px, keeping the 1-column layout, which will then transition to 2-columns layout on >=768px.
  • Changed the UC's headings to be inline-blocks to prevent the weird layout issues.
  • Removed the unnecessary float: left .from pull-left inside the well.
  • Changed .media to be flex, thus achieving proper wrapping.
  • For widths >=992px and <1200px, .course-info-container has a padding bottom of 1.5rem and .media-body a height of 6rem, to support really long titles (Looking at you and your 131 characters, APSEI -__-). On widths >=1200px, these are both set to 0rem, since they add unnecessary height, and it's only really an issue (for the tested course, APSEI) at size >= 1200px and <=1212px.

Version 19.07.4a - More Url Fixes.
Fixed the urls not having the proper colors in the page elearning uses for redirecting

Version 19.09.1 - Fixes everywhere.
elearning got updated, and with that came many HTML + CSS changes.
This version will be mostly consisted of restoring (as best as possible...) to have the same behaviour & design we had previously.

  • Changed sidebar icons margin-right values to match those of fontawesome (we had 5px previously, now back to FA's original 0.5rem)
  • Fixed sidebar icons not using the proper margin-right values due to CSS clashing.
  • Fixed navbar not getting expanded, due to using the (now) wrong id name (used to be #navwrap, it's now #main-navbar)
  • Fixed navbar's dropdowns' icons not showing up (had to remove bootstrap's dropdown icons, still using FontAwesome's).
  • Fixed last child the navbar having padding cut off (just looks weird). Might replace the padding by centering the content of the nav-item.

Version 19.11.1 - More Fixes
Continuing where we left off, since last time was incomplete

  • Cleaned up a lot of unnecesary code related to previous website version. (still not finished tho)
  • Fixed alignment issues with sidebar + main content (now uses same padding values as #region-main)
  • Fixed consistency of viewing content + sidebar in both UC details + dashboard view (now has same padding values)
  • Changed sidebar's titles' colours + sizes to make it more readable
  • Fixed some sidebar menus not showing underline on hover (some had spans, some links were under a different class... (type_structure vs type_course vs type_container...))
  • Fixed Vertical alignment of icons + text in sidebar (the container li.item_with_icon p.tree_item.hasicon also needed flex display)
  • Changed a few more links to display the underline, visited, and new colour (for the forum links)
  • More navbar fixes (changed + fixed paddings applying properly, fixed consistency throughout sizes, at default and max-width(1199px) breakpoint)
  • Fixed alignment of breadcrumb in UC details (weird as hell...) However, it's not fixed for the max-width(991px) breakpoint
  • Adjusted navbar's settings icon + :after to match other dropdowns ( region-main-settings-menu), as well as other fixes. (though that whole HTML is screwed up, so it'll probably only be hacks).
  • Fixed News' Forum's dropdowns having border-radius (unnecessary since they only have 1 element)
  • Fixed News' Forum's author icon not being centered (was probably someone forgot to add the equivalent flex class/properties)
  • Changed News' Forum's introbox to be more fitting, by increasing font-size + removing margins

Version 19.11.1a - Link Fixes + Fixing Regression
Some minor fixes that could have made it last version

  • Fixed more sidebar links on news (.block_news_items), activities (.block_activity_modules), and course_list (block_course_list)
  • Fixed sidebar's course_list's courses' icons not having necessary margin-right (as it was removed during navbar changes), behaviourn now matches other sidebar's icons

Source code

Source code has over 10K characters, so we truncated it. You can inspect the full source code on install link.
/* ==UserStyle==
@name           eLearning@UA - QoL fixes & other random things
@namespace      USO Archive
@author         nightershadow
@description    `As the name implies, changes that will make using eLearning easier, along with some random things I think of along the way.Most notable changes are improved layouts as well as links more distinguishable from text.Made with some free time™ by a former LEI student.[2019-11-18 NOTE: Screenshots will be updated whenever 2 breakpoints are done properly... Which due to time constraints + hacks needed, might not be this year]`
@version        20191118.5.8
@license        CC-BY-NC-SA-4.0
@preprocessor   uso
==/UserStyle== */
@-moz-document domain("elearning.ua.pt") {
    :root {
        --navbar-font-size: 12px;
        --navbar-padding-right: calc(var(--navbar-font-size) * 1.2);
        --navbar-padding-top: calc(var(--navbar-font-size) * 0.4);
        --navbar-padding-dropdown: calc(var(--navbar-padding-right) * 1.6);
        --navbar-padding: var(--navbar-padding-top) var(--navbar-padding-right);
        --buttons-radius: 8px;
        --main-color: #A5CA56;
        --darker-color: #729723;
        --default-title-color: #333;
        --container-spacing: 1.25rem;
    }

    /* Media Queries for fixing stuff that was broken by the custom classes and/or changing size of the page*/

    @media only screen and (max-width:576px),
    only screen and (max-width: 768px) {

        #page.container-fluid > .container,
        #main-navbar > .container {
            width: 95%;
        }
    }

    @media only screen and (min-width: 768px) {

        #page.container-fluid > .container,
        #main-navbar > .container {
            width: 90%;
        }
    }


    @media only screen and (min-width: 992px) {
        :root {
            --navbar-padding-right: calc(var(--navbar-font-size) * 0.7);
            --navbar-padding-top: calc(var(--navbar-font-size) * 0.2);
            --navbar-padding-dropdown: calc(var(--navbar-padding-right) * 2);
        }

        #page.container-fluid > .container,
        #main-navbar > .container {
            width: 85%;
        }

        .course-info-container {
            padding-bottom: 1.5rem;
        }

        .media {
            flex: 1 1 auto;
            display: flex;
        }

        .media-object,
        .media > .pull-left,
        .media-heading {
            display: inline-block;
        }

        .media > .pull-left {
            float: none;
        }

        .media-body {
            height: 6rem;
        }

    }

    @media only screen and (min-width: 1200px) {
        :root {
            --navbar-font-size: 1rem;
        }

        #page.container-fluid > .container,
        #main-navbar > .container {
            width: 85%;
        }

        .course-info-container {
            padding-bottom: 0rem;
        }

        .media-body {
            height: 0rem;
        }

    }

    /* reset fix */
    .m-t-2 {
        margin-top: 0px !important;
    }

    .media,
    .media-body {
        overflow: visible;
    }

    /*  New Event Modal */

    .fcontainer {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .fitem {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-flex: 1;
        -ms-flex: 1 1;
        flex: 1 1;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
    }

    .fitem fieldset {
        width: auto;
    }

    .fitemtitle {
        -webkit-box-flex: 0;
        -ms-flex: 0 180px;
        flex: 0 180px;
        -ms-flex-item-align: start;
        align-self: flex-start;
    }

    /* Proper Reset */
    .mform .fitem .felement {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        -ms-flex-item-align: end;
        align-self: flex-end;
        margin-left: 10px;
        width: auto;
    }

    /* Removing unnecessary margin from icons */
    .icon {
        margin-right: 0;
    }

    img.icon,
    #adaptable-page-header-wrapper #main-navbar .nav-item i,
    #adaptable-page-header-wrapper #main-navbar a.dropdown-item img.icon {
        padding-right: 0px;
        margin-right: 4px;
    }


    /* Dropdown Fixes */
    .dropdown-menu,
    .dropdown-menu * {
        box-sizing: border-box;
    }

    .dropdown-menu {
        padding: 0px;
        min-width: 100%;
    }

    .dropdown-menu {
        border-radius: 0px 0px 10px 10px;
    }

    .dropdown-menu > li:last-child > a:hover {
        border-radius: 0px 0px 10px 10px;
    }

    li.dropdown > ul.dropdown-menu > li > a {
        border: none !important;
        color: rgb(54, 91, 26) !important;
        padding: 4px 10px 6px 10px;
    }

    /* 
Still using fontawesome's icon, because it's just more visible than Bootstrap's 
(+ no conflict with alignment)
*/
    #adaptable-page-header-wrapper #main-navbar .dropdown-toggle:after,
    #adaptable-page-header-wrapper #nav-drawer .dropdown-toggle:after,
    #adaptable-page-header-wrapper #main-navbar .action-menu .dropdown-toggle:after {
        /*&nbsp, &nbsp, arrow character*/
        font-family: 'FontAwesome';
        content: "\00a0\00a0 \f107";
        vertical-align: 0;
        margin-left: 0;
        border: 0;
    }

    /* (#region-main-settings-menu)
Bringing some fixes to the cog
Taking out the needless margin...
*/

    .context-header-settings-menu,
    .region-main-settings-menu,
    #region-main-settings-menu > div,
    #region-main-settings-menu {
        position: static;
        float: none;
        right: 0;
    }

    #region-main-settings-menu,
    .region-main-settings-menu {
        padding: var(--navbar-padding-top) var(--navbar-padding-right);
        margin-top: 8px;
    }

    /* 
Not sure why they used the navbar-nav to apply the settings, but must have
been for some valid reason...
Instead, we're forced to use these
*/
    #adaptable-page-header-wrapper #main-navbar .action-menu .dropdown-toggle:after {
        position: relative;
        top: -10px;
    }

    /* 
Unecessarily lengthy rule... 
Not sure why add a rule over 2 IDs....

Resetting the padding on the last child in the navbar, because it'd look weird
having text cut out. 
TODO: Maybe replace the last-child fix with a centering of the text

Resetting the paddings to the defaults 
*/
    #adaptable-page-header-wrapper #main-navbar .navbar-nav > li > a,
    #adaptable-page-header-wrapper #main-navbar .navbar .navbar-nav > li:last-child a {
        font-size: var(--navbar-font-size);
        padding: var(--navbar-padding);
    }

    /* 
Except for dropdowns, which we need to increase a tiny little bit on the padding right
*/
    #adaptable-page-header-wrapper #main-navbar .navbar-nav > li.dropdown > a,
    #adaptable-page-header-wrapper #main-navbar .navbar .navbar-nav > li.dropdown:last-child a {
        padding-right: var(--navbar-padding-dropdown);
    }

    .block .header {
        border: none;
    }

    /** Forum Fixes ( see element tr.discussion ) **/

    /* Removing border-radius from forum-discussion's menus */
    tr.discussion .dropdown-menu {
        border-radius: 0;
    }

    /* Fixed Author's image not being centered */
    td.author > div,
    td.author ~ td.text-left > div {
        align-items: center;
    }

    #intro.generalbox {
        margin-right: 0;
        margin-left: 0;
        width: 100%;
        font-size: larger;
    }

    /* Breadcrumb Fixes (#page-navbar)
Peculiar fix... Breadcrumb navbar needs no padding on the left, and same padding on the right to match alignment with both sidebar + main content, since they're not bound
by the `.col-*` classes 
*/
    #page-navbar {
        padding-left: 0;
        padding-right: var(--container-spacing);
    }

    /* (.breadcrumb)
And in order to restore (what I'd guess) proper intention, 
breadcrumb needs to have the same padding-left... this is weird
Restoring original breadcrumb padding */
    .breadcrumb {
        padding: .25rem 0 .25rem var(--container-spacing);
        border-radius: 4px;
        border: 1px #e3e3e3 solid;
    }

    /* (#page-content) 
Since both #region-main and #block-region-side-post 
need 1.25rem to stay align, moving them upwards in the markup
to avoid having 2 rules that do the same
*/
    #page-content {
        margin-top: var(--container-spacing);
    }

    /** MainContent + Sidebar Fixes ( #region-main, #block-region-side-post ) **/
    /* 
#region-main - Fixing display on dashboard to make it consistent with UC's view...
    - Replacing top-padding with margin, to make it semantically relevant, moved to #page-content
#block-region-side-post - Fixing alignment with #region-main 
    - Margin for semantic vertical alignment, moved to #page-content
    - Padding for centering
*/
    #block-region-side-post,
    .pagelayout-mydashboard #region-main,
    #region-main {
        padding: 0px var(--container-spacing);
        margin-top: 0;
    }

    #block-region-side-post,
    #block-region-content .header {
        border: 1px #e3e3e3 solid;
        border-radius: 4px;
    }

    /* Replacing margin with padding */
    .block .calendar_filters li {
        margin-bottom: 0px;
        padding: .2em;
    }

    /* Unnecessary margin since now padding exists*/
    #block-region-side-post .block {
        margin-bottom: 0px;
    }

    .block.block_fake > .content {
        padding: 0px;
        padding-left: 6px;
    }

    .block.block...

Reviews

No reviews yet.