-
Notifications
You must be signed in to change notification settings - Fork 69
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
[BD-46] docs: replaced SCSS variables with CSS variables on the Colors page #2376
[BD-46] docs: replaced SCSS variables with CSS variables on the Colors page #2376
Conversation
Thanks for the pull request, @PKulkoRaccoonGang! When this pull request is ready, tag your edX technical lead. |
cb61cf6
to
745cfbc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #2376 +/- ##
=======================================
Coverage 91.95% 91.95%
=======================================
Files 216 216
Lines 3618 3618
Branches 891 891
=======================================
Hits 3327 3327
Misses 286 286
Partials 5 5 ☔ View full report in Codecov by Sentry. |
@PKulkoRaccoonGang I think that code could be greatly simplified on this page since we use CSS variables now. Previously we used const styles = getComputedStyle(document.body);
function Swatch({ name, colorClassName, isUnused }: ISwatch) {
const computedValue = styles.getPropertyValue(name);
return (
<div className="d-flex align-items-center mb-2">
<div
className={classNames('p-3 mr-2 rounded', colorClassName, {
'unused-level': isUnused,
})}
/>
<div style={{ lineHeight: 1 }} className="small">
<code className="mb-0 d-block text-lowercase text-dark-700">
{`var(${name})`}
</code>
<code style={{ fontSize: '65%' }} className="text-muted">
{computedValue}
</code>
</div>
</div>
);
}
// usage example, note that you need to pass var's name to the "name" prop without wrapping it in 'var'
<Swatch name="--pgn-color-accent-a" colorClassName="bg-accent-a" /> I believe this lets you completely remove usages of Also, there's something wrong with the borders they render with same styles for some reason, although they should have different colors. I'll let you figure this one out on your own 😛 |
✅ Deploy Preview for paragon-openedx ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@PKulkoRaccoonGang I noticed you pushed a commit with my suggestions, but I still see issues with borders that I described above. Just reminding you in case you missed or forgot about that part. If you just didn't have time to look at that yet, that's ok 🙂 Also, deploy preview is failing now because you used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left 1 comment alongside Viktor's feedback.
The only high-level feedback about the page I have might be about whether we can have the "accents" colors shown as the last color variants in the UI given there's only 2 of them (throws off the visual grid haha) and are generally less commonly used (non-blocking, can be deferred).
ccb270c
to
9ba0ed5
Compare
845c058
to
3959934
Compare
3959934
to
95c28ea
Compare
9595d72
to
12a2267
Compare
@PKulkoRaccoonGang 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
🎉 This PR is included in version 22.0.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 23.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…2376) * docs: replaced SCSS variables with CSS variables on the Colors page of the documentation site * refactor: refactoring after review * refactor: refactoring after review * fix: removed extra commons.css generation * refactor: code refactoring * refactor: removed Colors package
…2376) * docs: replaced SCSS variables with CSS variables on the Colors page of the documentation site * refactor: refactoring after review * refactor: refactoring after review * fix: removed extra commons.css generation * refactor: code refactoring * refactor: removed Colors package
…2376) * docs: replaced SCSS variables with CSS variables on the Colors page of the documentation site * refactor: refactoring after review * refactor: refactoring after review * fix: removed extra commons.css generation * refactor: code refactoring * refactor: removed Colors package
…2376) * docs: replaced SCSS variables with CSS variables on the Colors page of the documentation site * refactor: refactoring after review * refactor: refactoring after review * fix: removed extra commons.css generation * refactor: code refactoring * refactor: removed Colors package
🎉 This PR is included in version 23.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Github issue
Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist