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

Update Tip Styling on Lesson Plan #37630

Merged
merged 3 commits into from Nov 3, 2020
Merged

Update Tip Styling on Lesson Plan #37630

merged 3 commits into from Nov 3, 2020

Conversation

dmcavoy
Copy link
Contributor

@dmcavoy dmcavoy commented Nov 3, 2020

  • Tip icon are colored the correct tip color
  • Add padding on the tip icon
  • Try to better space the tips and activity section markdown

Updated based on feedback from the bug bash

Screen Shot 2020-11-02 at 10 09 55 PM

const tipWidth = Math.min(
Math.round((tipsTotalLength / totalLengthOfSectionText) * 100),
75
);
Copy link
Member

Choose a reason for hiding this comment

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

Cool! I am interested to see how well this heuristic performs. If this heuristic is not good enough, there are also some places where we render the element and then measure its height, like here:

const measureElement = element => {
const DOMNode = ReactDOM.findDOMNode(element);
return {
height: DOMNode.offsetHeight
};
};

If you go that route, you have to be careful not to get into an infinite loop, because changing the width can change the height. There are ways to deal with this, but we can probably put off solving that for now.

@dmcavoy dmcavoy merged commit 07fd28e into staging Nov 3, 2020
@dmcavoy dmcavoy deleted the tip-icon branch November 3, 2020 14:09
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.

None yet

2 participants