Skip to content

Style Masteriyo's course pages on the site's design - #274

Open
amjadr360 wants to merge 25 commits into
mainfrom
feature/masteriyo-styles
Open

amjadr360 wants to merge 25 commits into
mainfrom
feature/masteriyo-styles

Conversation

@amjadr360

Copy link
Copy Markdown
Contributor

Masteriyo's course pages now look like they belong to the site. They pick up its colours, fonts, spacing and other style from theme.

Masteriyo ships its own blue and white on every page and has no dark
mode, so course pages clashed with the site and went unreadable on
dark palettes. The new stylesheet points Masteriyo's colour variables
at the theme's tokens and dresses its course card, Courses page and
Immersive course page; it loads only with Masteriyo active, after
Masteriyo's own stylesheet so it wins the cascade.

Masteriyo's four colour settings keep working: each one takes the
palette's colour only while it still holds Masteriyo's factory value,
so a colour the site owner picks always shows. Nothing writes to
Masteriyo's settings.
The Courses Page settings for button radius, button size and the
course title's font size print as an unconditional !important,
whatever their value, so the stylesheet's own rules beat them even
once an owner picked something else. Each of those three rules now
needs a body class the theme adds only while its setting still holds
Masteriyo's factory value, so a changed setting falls back to
Masteriyo's own styling with nothing left to fight it. The highlight
side setting has no rule to guard, since nothing here ever touched it.

Catches up the rest of the stylesheet with the pattern work done since
the last sync: the card's category, title, description and price
spacing, a square photo crop, and the view-mode toggle hidden on the
courses block.
The related-courses cards on the other course layouts print the same
rows, and those layouts keep Masteriyo's own look.
Masteriyo's hover rules swap a filled button's label to its white and
turn title links its brand fill, both unreadable on a light brand.
Hover keeps the brand's own label ink and the UI-link ink; hardcoded
greys on cards, curriculum and stats follow the palette.
Masteriyo derives tints from its factory blue and never reprints them,
so a hovered Collapse All stayed blue; they now follow the palette. Its
tabs turned the pale brand fill as text and dropped the focus outline.
The card photo takes the open card's 4:3 and the title its card-title
size, so the live courses block reads as the pattern's static body.
The Courses page and every course page sat at the screen edge in
Masteriyo's own fixed box, wearing its corners, shadows, type sizes and
hardcoded colours. They now take the shop and product page frame and the
site's own card, title, price and tabs styles, on all four single-course
layouts, with Related Courses dressed as the course card.

The course card's button is the store card's small secondary button, whose
fill, edge and ink are new entries in the settable-colour map: the PHP
prints them only while Masteriyo's Button color settings hold their
factory values, so an owner's chosen colour still shows.

Generated from the design source; the map gains three entries under
general.styling.button_color and one under button_hover_color.
The overlay and list-view course cards now follow the site's card style;
the overlay's text sits on a dark scrim so it stays readable on any photo.

The account dashboard takes the site's colours: its React app writes its
palette as CSS variables on :root, and the same variables on the page
body win. Its brand and button colours follow the site only while
Masteriyo's styling colours are left at their defaults.

Checkout hides the empty title band left by Masteriyo blanking the page
title, uses the wide width so Masteriyo's two-column layout shows, and
matches the WooCommerce checkout's fields, titles, summary and notices.
The receipt now sits on the site's card style, spaced from the title band, with the site's success notice and its account and invoice links underlined so they read as links.
Signed out, each form now sits on the site's card style with the site's headings, labels and fields, spaced from the header and footer like the other course pages.
The sign-in, sign-up and reset password cards sat tight under the header with no page title over them; they now have a larger step of space above and below.
The account app's tiles, fields and buttons now take the site's corner style, and the app uses the wide width with room above and below.
The Modern card now uses the site's card face and corners, with its title and price matching the other course cards.
Category cards, the curriculum box, course photos and author avatars follow the site's style. The Courses page gets its grid or list switch back on the title row, list view keeps the price over a full-width button, the review form's Cancel matches Submit, and the account app lines up with the header.
Course progress uses the site's text colours and a visible track, the related course photo no longer covers the card's text, and the Courses page's grid or list switch sits before the search.
On a wide screen the title, view switch and search ran wider than the course grid below them and than the site header's logo; all three now line up.
Masteriyo tints the hero with the site's main colour, so on a light colour the band came out pale and the hero's white category, date and author text vanished; all of the hero's text now follows the band.
The course page's hero and the overlay course card now sit under the same dark overlay as a cover, with light text, so they stay readable on dark and light palettes alike.
The editor canvas runs neither wp_enqueue_scripts nor body_class, and Masteriyo's own editor stylesheet loads into it after the theme's and resets its colours to Masteriyo's blue. So in the editor, Masteriyo's blocks showed blue buttons and Masteriyo's own corners while the front end showed the site's.

The canvas now gets the theme's Masteriyo colour rule and the still-at-default colour settings one step more specific, and the default-setting body markers, put back whenever the editor resets the canvas body's classes.
The theme's PHP reads assets/css/masteriyo-settable-colors.json at runtime to decide which Masteriyo colours are still at their defaults. The zip packed only CSS from assets/css, so an installed theme had no map and left every Masteriyo colour as Masteriyo's own.
functions.php now loads the file once, behind one class_exists check,
instead of testing for Masteriyo at each of three call sites. Plugins
load before the theme, so the class is known when functions.php runs.
The stylesheet enqueue and editor style move into their own hooks there.
The store card face is tertiary in every vibe, so on a tertiary section
the course cards disappeared into the band. They now take the page
background there, as the site's own cards do.
The theme lints its generated stylesheets now, and the design source
writes this one to the WordPress Stylelint rules. The rules are the
same; only the spelling moves: quoted attribute values and a blank line
before each comment.
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

Successfully merging this pull request may close these issues.

1 participant