Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74869

Activity icon colors should be SCSS variables so they are easy to override.

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_403_STABLE
    • MDL-74869-activity-icon-color-map
    • Hide
      1. As Admin, purge caches.
      2. Go to a course with activities, e.g. a quiz and an assignment.
      3. Verify the icon background colors look unchanged.
      4. In Admin->Appearance->Theme->Boost->Advanced Settings->Raw initial SCSS,
        assign a different colour to the assessment activities colour variable by inserting:

         $activity-icon-assessment-bg : #7538a0;

      5. Save.
      6. Navigate to the course.
      7. Verify that the background colour of the icons should corresponds to the chosen colours (in this case: assignment and quiz icons have a deep purple background.
      Show
      As Admin, purge caches. Go to a course with activities, e.g. a quiz and an assignment. Verify the icon background colors look unchanged. In Admin->Appearance->Theme->Boost->Advanced Settings->Raw initial SCSS, assign a different colour to the assessment activities colour variable by inserting: $activity-icon-assessment-bg : #7538a0; Save. Navigate to the course. Verify that the background colour of the icons should corresponds to the chosen colours (in this case: assignment and quiz icons have a deep purple background.

      The new color coding for activity icon types is neat.

      It would be simpler to override if they were set as variables with default values first and then added to the array.

      Then you'd just need to set the variable. See the way bootstrap sets its basic colors before adding them to their array for an example.

       

      $activity-icon-colors: () !default;
      $activity-icon-colors: map-merge(
          (
              "administration": #5d63f6,
              "assessment": #eb66a2,
              "collaboration": #f7634d,
              "communication": #11a676,
              "content": #399be2,
              "interface": #a378ff
          ),
          $activity-icon-colors
      );
      

      vs

      $primary:       $blue !default;
      $secondary:     $gray-600 !default;
      $success:       $green !default;
      $info:          $cyan !default;
      $warning:       $yellow !default;
      $danger:        $red !default;
      $light:         $gray-100 !default;
      $dark:          $gray-800 !default;$theme-colors: () !default;
      $theme-colors: map-merge(
        (
          "primary":    $primary,
          "secondary":  $secondary,
          "success":    $success,
          "info":       $info,
          "warning":    $warning,
          "danger":     $danger,
          "light":      $light,
          "dark":       $dark
        ),
        $theme-colors
      );
        

            benjamin-unige Benjamin-unige
            bawjaws David Scotson
            Luca Bösch Luca Bösch
            Jake Dallimore Jake Dallimore
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 22 minutes
                1h 22m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.