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

EuiMark for highlighting text content #2085

Closed
snide opened this issue Jul 2, 2019 · 9 comments
Closed

EuiMark for highlighting text content #2085

snide opened this issue Jul 2, 2019 · 9 comments

Comments

@snide
Copy link
Contributor

snide commented Jul 2, 2019

We have a lot of places in our layouts where we highlight text content. Principal examples are Discover and the Log UI but I'm sure there are more. We should probably make a new component EuiMark to standardize this.

  • Should prolly generate an HTML mark element. https://www.w3schools.com/tags/tag_mark.asp
  • Similar to EuiBadge should probably accept both a named color prop as well as a hex value. There are plans in the Logs UI to have multiple highlights (with color selection) in play at once.

This originally cam up in elastic/kibana#39569 (review)

@cchaos
Copy link
Contributor

cchaos commented Jul 2, 2019

How would this component be different from EuiHighlight? Or should EuiHighlight be altered to allow these extra color selections and use <mark> at the DOM level?

@snide
Copy link
Contributor Author

snide commented Jul 2, 2019

I think preferably EuiHighlight would use EuiMark for it's actual highlighting. EuiMark I would see as simply a display component.

We'd likely want a transparent and strong option as well.

@chandlerprall
Copy link
Contributor

It (or the underlying logic function) should produce some kind of structured data that can be mapped into e.g. HTML/mark. This leaves it open for other implementations as well.

@thompsongl
Copy link
Contributor

Any one have any time or work invested in this yet? If so, I'll look elsewhere. If not, I may use it as a from-scratch comparison for the different styling solutions.
At the very least there'll be starting place if someone is interested in finishing it.

@snide
Copy link
Contributor Author

snide commented Jul 25, 2019

@thompsongl I have not. My plan was the following props

<EuiMark color="" strong em>text only string</EuiMark>

with that just generating a <mark className="euiMark euiMark--colorWhatever">tag</mark>

We have the following potential usage:

  • Logging ui highlights stuff in the log lines
  • Discover highlights stuff within the results
  • Codesearch has lots of highlighting within their app'
  • Combobox results within the dropdown

Generally a bright yellow, with dark text is the norm for coloring. In cases like EuiHighlight or combobox results, we have no background, and instead bold things.

@mridulgogia
Copy link
Contributor

The required result is to highlight the text just like it is highlighted with a highlighter(like labels, above)?

If yes, do we need a new component or should we extend the functionality of the EuiMark feature?

@thompsongl
Copy link
Contributor

@mridulgogia The EuiMark component does not yet exist. This issue is meant to result in the creation of that component, solving the use cases discussed above.

I had done some initial work on this issue several months ago, although I don't believe the branch to be feature-complete. Anyone is welcome to take up where I left off: https://github.com/thompsongl/eui/tree/euimark/src/components/mark

@mridulgogia
Copy link
Contributor

Can i work on this issue?

@mridulgogia mridulgogia mentioned this issue Feb 28, 2020
9 tasks
This was referenced Mar 10, 2020
@cchaos
Copy link
Contributor

cchaos commented Mar 18, 2020

Closed via #3060

@cchaos cchaos closed this as completed Mar 18, 2020
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

5 participants