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

refactor(canvas-lms): rewrite #1084

Open
wants to merge 102 commits into
base: main
Choose a base branch
from

Conversation

pynappo
Copy link

@pynappo pynappo commented Jul 18, 2024

(reopening because I didn't name my branch properly, apologies)

🔧 What does this fix? 🔧

  • Borders are themed to less standout colors
  • User content (i.e. text with user-added highlights/text color) will keep their original styles when needed
  • Course-specific colors are preserved
  • Links are themed
  • Buttons are themed and have proper hover color changes
  • Accent color is more prominent wherever appropriate
  • Doesn't have Solid bar on top of quizzes #368 although I haven't seen the issue with the old nor the new userstyle, maybe due to new canvas changes
  • School-specific brand colors are kept on the global nav sidebar (down to change but personally i think it's nicer this way)
  • etc.
Before/After on Catppuccin Mocha with Green accent color

(white borders on the screenshot are my browser not the userstyles)

Dashboard

Before
current dashboard

After
rewrite dashboard

Example Course Homepage

Before
current course homepage

After
rewrite course homepage

Example Quiz

Before
current quiz

After
rewrite quiz

Example Course Modules

Before
current modules

After
rewrite modules

I've themed the main pages that I've used as a student during my courses.

A lot of the canvas CSS is autogenerated but with stable suffixes/prefixes/children, hence the high use of attribute selectors and such. edit: apologies for the large line count increase, styling the site properly is a pain.

🗒 Checklist 🗒

  • I have read and followed Catppuccin's contributing guidelines.
  • I have updated the version appropriately in the ==UserStyle== header of the catppuccin.user.css file.
  • Add webp
  • Theme less-used pages (Canvas Studio, instructor-side UI, etc)
    • styled a few of the instructor-side pages and Canvas Studio, leaving the rest for later since students like me only use like 20 pages
  • Test Latte theme
  • See if anything should be added to the userstyles.yml readme
  • Clean up the CSS

temporary update:

Haven't had time to really work on this because I've got finals until 12/17, sorry. If I don't have access to my classes after this I'll setup a canvas class on the main Canvas instance (canvas.instructure.org) to more systematically style the site instead of just styling stuff as I notice it.

@github-actions github-actions bot added the canvas-lms Canvas LMS label Jul 18, 2024
styles/canvas-lms/catppuccin.user.css Outdated Show resolved Hide resolved
styles/canvas-lms/catppuccin.user.css Outdated Show resolved Hide resolved
Copy link
Member

@uncenter uncenter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some unthemed areas I'm noticing:

Assignment status (green text):

CleanShot 2024-11-12 at 09 55 43
CleanShot 2024-11-12 at 09 57 54

Submit/new attempt bar and button at bottom of assignment page:

CleanShot 2024-11-12 at 09 56 24
CleanShot 2024-11-12 at 09 58 10

The bar is also unthemed (probably the same bar but just for example) on assignments without submission:

CleanShot 2024-11-12 at 10 00 45

Apply button on grades page should be normal accent, not sure why it is this dark:

CleanShot 2024-11-12 at 09 57 19

Side bar color:

CleanShot 2024-11-12 at 09 58 29

Dashboard list view notifications indicator and modal:

CleanShot 2024-11-12 at 09 59 09

The notification counter/indicator (marked with an arrow) should be themed, as should the bar under the tabs, as should the notification content.

Web URL submission box:

CleanShot 2024-11-12 at 10 01 41

File upload submission box:

CleanShot 2024-11-12 at 10 02 02

Rubric tables look off because the text has a different background to the table itself:

CleanShot 2024-11-12 at 10 02 46

styles/canvas-lms/catppuccin.user.css Outdated Show resolved Hide resolved
@uncenter
Copy link
Member

Missing tag thingy is unthemed:

CleanShot 2024-11-12 at 10 21 37

And speaking of the file upload thing I mentioned in the above comment, the modals for the Canvas Files and Webcam Photo and probably Media Recording as well are unthemed:

CleanShot 2024-11-12 at 10 22 04

@uncenter
Copy link
Member

I was able to use the following CSS to theme all of those little and sometimes big spinners Canvas uses:

[class*="spinner__circleTrack"] {
    stroke: @surface1 !important;
}
[class*="spinner__circleSpin"] {
    stroke: @accent-color !important;
}

@uncenter uncenter added the waiting on author Note for staff that a re-review is not yet required label Nov 13, 2024
@uncenter
Copy link
Member

I'm going to add a "waiting-on-author" label - no pressure, just signals to maintainers at a glance that a review is not required yet. Please leave a comment once you believe you have implemented the suggested changes and fixed the unthemed areas :)

@pynappo
Copy link
Author

pynappo commented Nov 13, 2024

For the assignment-page/upload styles, i don't think canvas.instructure.com nor my school's instance has Enhanced Assignments enabled so I can't get those pages to show up on my end - if I could get some html snippets/css styles for those that'd be greatly appreciated.

For sidebar, I left that unstyled because I thought it would help with people who enroll at multiple colleges. Should I just style it according to accent-color?

@uncenter
Copy link
Member

For sidebar, I left that unstyled because I thought it would help with people who enroll at multiple colleges. Should I just style it according to accent-color?

I would say make it mantle?

@uncenter
Copy link
Member

Pushed some fixes. Not complete yet, and not in the right place lol. Trying to juggle some files with new documentation I plan to introduce to go along with some of the stuff in that commit. If you want you can organize the new enhanced assignments section stuff I added into the right place and I'll keep working on it wherever you move it to when I get back to it.

@uncenter
Copy link
Member

Lots of these buttons all over, I themed some more specifically in the enhanced UI section but we should get better selectors to match them all.

(from a discussion)

image

Here is the HTML from above for your reference:

<span class="discussion-topic-reply-button"><button dir="ltr" data-testid="discussion-topic-reply" cursor="pointer" type="button" tabindex="0" class="css-1iimhyf-view--inlineBlock-baseButton"><span class="css-1mnegct-baseButton__content"><span class="css-11xkk0o-baseButton__children"><span wrap="normal" letter-spacing="normal" class="css-1fvrx9c-text">Reply</span></span></span></button></span>

Canvas is using the following CSS to theme it:

.css-1mnegct-baseButton__content {
    box-sizing: border-box;
    width: 100%;
    display: block;
    direction: inherit;
    user-select: none;
    transition: background 0.2s, transform 0.2s;
    transform: none;
    font-family: LatoWeb, "Lato Extended", Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    border-style: solid;
    border-width: 0.0625rem;
    border-radius: 0.25rem;
    line-height: 1.125;
    text-align: center;
    font-size: 1rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    color: rgb(255, 255, 255);
    background: rgb(3, 116, 181);
    border-color: rgb(2, 84, 131);
}

.css-1iimhyf-view--inlineBlock-baseButton:hover > [class$="-baseButton__content"] {
    background: rgb(2, 84, 131);
}

You can see -baseButton__content is part of the class that is targeted here. Searching this finds that you are already theming some of these types of buttons, though you are using autogenerated classnames in some places - please avoid that if possible so we can catch more of these buttons in our theming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canvas-lms Canvas LMS waiting on author Note for staff that a re-review is not yet required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants