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

Display the video title - add title attribute #88

Merged
merged 9 commits into from
Mar 3, 2024

Conversation

jakeparis
Copy link
Contributor

This PR adds a title attribute so the pre-clicked element displays a title. The title's style is basically the same as YouTube's.

src/lite-yt-embed.js Outdated Show resolved Hide resolved
font-family: "YouTube Noto",Roboto,Arial,Helvetica,sans-serif;
color: hsla(0,0%,100%,.9);
text-align: left;
direction: ltr;
Copy link
Owner

Choose a reason for hiding this comment

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

i think this is a bit overstyled. i want the CSS & JS to be as small as reasonably possible, so i'd like to only include these if totally necessary. Can you whittle these down a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed extraneous things, and moved styles to ::before element. Also, I changed the background from a base64 encoded svg into a linear-gradient, because the svg isn't stretching correctly when title text expands the element.

src/lite-yt-embed.js Outdated Show resolved Hide resolved
@paulirish paulirish changed the title Added a title attribute to render title prior to load Display the video title - add title attribute Nov 28, 2021
@paulirish
Copy link
Owner

Thank you jake! appreciate the fine work here.

@paulirish paulirish merged commit 498a4f3 into paulirish:master Mar 3, 2024
1 check passed
@paulirish
Copy link
Owner

@jakeparis i notice now...

That you took the element's title attribute value and then move it to data-title. But.. we could drop that line of JS and instead ask the developer to provide a data-title attribute. Do you (or anyone else) have a preference?

(Also I now see some overlap with the intention of playLabel and this title, but the current treatment seems to be OK)

Lastly, I know you did this YEARS ago so if you totally forget.. no worries. <3

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

3 participants