-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature: Different Note Boxes in Lesson Content #3431
Comments
@KevinMulhern @ChargrilledChook @01zulfi can I work on this one next? |
I haven't started any substantial work on this one yet. I'm happy to let you tackle this one @cleicar 🚀 I don't think we had any note boxes set in stone, but below is a prototype of what I had in mind: |
- [x] Note - [ ] Tip - [ ] Warning Closes TheOdinProject#3431
Where can I find an example of the following lesson-note type? |
We don't have anything in the system like those atm @JuanVqz. The couple of examples on this issue is the kind of thing we're looking for. |
@JuanVqz Checking in to see if any progress has been made on this issue |
Hey, I haven't made any progress on this one |
@JuanVqz Are you willing to continue this issue? If not, that's fine as well. |
At this point, I cannot do it, sorry about that, and thanks for the heads up! Good day! |
Thanks for letting us know @JuanVqz |
@KevinMulhern Hi, I would like to work on this issue if it is still open. I feel it is fairly easy add-on. |
Thanks @luuu-xu, it's all yours 💪 |
Thanks @KevinMulhern, since this will be my first open source contribution, I'd like to get some help from you.
Wow that's a lot of questions, I am sorry about asking every detail of this issue, I am just eager to make this PR my great first contribution! |
No worries @luuu-xu, happy to help.
CSS classes sounds perfect, we're using BEM notation for our custom classes so we could add some modifier classes for each: <div class="lesson-note lesson-note--warning" markdown="1"`
We're using Tailwind color system on the site, you can find a full list of those here.
The easiest thing would be to use Fontawsome icons, we have it available in the app.
I think we'll be able to do this with a before pseudo class, Something like this should work: .lesson-note--info > h4::before {
font-family: "Font Awesome 5 Free";
font-weight: 900;
content: "\f05a";
@apply mr-2;
} Markup to make this work: <div class="lesson-note" markdown="1">
<h4>title</h4>
</div>
Yep, I agree it looks odd with just the icon. Let's include a title after the icon like js.info are doing it.
Instead of doing all three lesson notes in one PR, I'd approach it like this:
After that, it will be trivial to add the styling for warning and tip lesson notes since all the patterns will be established and agreed upon by everyone involved. |
@KevinMulhern Hi, after some frustrating hours of setting up the environment on the M1 iMac I have, I have added the CSS variations and requested PR. During the works, I found out the markdown files are fetched from curriculum's github url directly so I couldn't find a way efficient enough for me to add the h4 title into the note box. But I have managed to finish the work, including colour choices for dark mode with WCAG contrast standards. Now should I go ahead and request a PR for curriculum repo where h4 title is added to the lesson note in this PR, though I'm not sure what title would best suit it. I am thinking "Make sure your OS is supported". |
Hey @luuu-xu, thanks for getting this done so quickly! You can test out the styling locally using our markdown preview feature, you can access that by going to |
Great feature!! I have made the changes from your suggestions and also added lesson-note--tip and lesson-note--warning to tailwind safelist so now they work great. Thank you for all the suggestions! |
<!-- Thank you for taking the time to contribute to The Odin Project. In order to get this pull request (PR) merged in a reasonable amount of time, you must complete this entire template. --> ## Because <!-- Summarize the purpose or reasons for this PR, e.g. what problem it solves or what benefit it provides. --> Different variations (note, extra, warning) of lesson note boxes draw attention to readers for important/warning information. ## This PR <!-- A bullet point list of one or more items describing the specific changes. --> - Added CSS classes to varied lesson note boxes, including the use of corresponding icon by Fontawesome. ## Issue <!-- If this PR closes an open issue in this repo, replace the XXXXX below with the issue number, e.g. Closes #2013. If this PR closes an open issue in another TOP repo, replace the #XXXXX with the URL of the issue, e.g. Closes https://github.com/TheOdinProject/curriculum/issues/XXXXX If this PR does not close, but is related to another issue or PR, you can link it as above without the 'Closes' keyword, e.g. 'Related to #2013'. --> Closes #3431 ## Additional Information <!-- Any other information about this PR, such as a link to a Discord discussion. --> ## Pull Request Requirements <!-- Replace the whitespace between the square brackets with an 'x', e.g. [x]. After you create the PR, they will become checkboxes that you can click on. --> - [x] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) - [x] The title of this PR follows the `keyword: brief description of change` format, using one of the following keywords: - `Feature` - adds new or amends existing user-facing behavior - `Chore` - changes that have no user-facing value, refactors, dependency bumps, etc - `Fix` - bug fixes - [x] The `Because` section summarizes the reason for this PR - [x] The `This PR` section has a bullet point list describing the changes in this PR - [x] I have verified all tests and linters pass after making these changes. - [x] If this PR addresses an open issue, it is linked in the `Issue` section - [ ] If applicable, this PR includes new or updated automated tests
Originally by @KevinMulhern
Why?
We are already using a standard note box which draws attention to important information https://www.theodinproject.com/lessons/foundations-installations#introduction
We could have different note boxes with different styles to give the information more context. For example
Tip - green icon/background
Warning - red icon/background
note - yellow or blue icon/background
Examples
JS Info
Warning box:
Note Box
The text was updated successfully, but these errors were encountered: