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

A way to have documentation on hover #298

Open
fcrozatier opened this issue Dec 11, 2024 · 1 comment
Open

A way to have documentation on hover #298

fcrozatier opened this issue Dec 11, 2024 · 1 comment

Comments

@fcrozatier
Copy link

Hey! It would be great to be able to have a small tooltip when hovering over classes used in templates, displaying their documentation similar to jsdoc.

What do you think of having a syntax similar to jsdoc with an additionnal @cssprop directive to document css custom variables used in a class? For types we could use CSS bracket notation <type> for example

Example (I'm using the to be implement exented attr() function but it's just for demo):

/*
  Displays elements in a grid with each column taking the same amount of space 
  
  @cssprop <length> --gutter — Space between items

  @attr <number> data-cols — The number of columns, set on the parent element
*/
.my-grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(attr(data-cols number, 1), 1fr);
}
@fcrozatier
Copy link
Author

Following up, would a PR going in this direction be welcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants