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

Customize offOpacity in animations #63

Closed
mhartington opened this issue Jul 12, 2019 · 4 comments
Closed

Customize offOpacity in animations #63

mhartington opened this issue Jul 12, 2019 · 4 comments

Comments

@mhartington
Copy link
Contributor

Hi there! Thanks for the awesome component.

Currently in the v2 branch, it seems that the offOpacity for code that is not focused is hard coded to 0.3. Is there any objection to either:

  • Moving this to the syntax theme?
  • exposing this as a prop on a component (code-surfer, code, etc)?

Depending on the display/theme/other factors, 0.3 doesn't really fade the code out as much.

If there's a better way to handle this, I'd be happy to send a PR.

@pomber
Copy link
Owner

pomber commented Jul 12, 2019

Reading the offOpacity from the theme shouldn't be difficult. I'll add it to the PR.

Ideally I'd like to add custom focus/not-focus styles to allow, for example, highligthing lines by changing the background instead of the opacity. But, at the moment, that's harder because of the custom animation pseudolibrary that I'm using.

@pomber pomber mentioned this issue Jul 12, 2019
19 tasks
@alpinegizmo
Copy link

I'd like to see something a little more general purpose than being able to customize the offOpacity. I'd like to be able to experiment with different ways of highlighting the focused region -- and for printing, I'd like to be able to ignore the focus and simply print everything undecorated.

I realized it's an old school way of thinking, but I'd be happy with classes that mark the focused and unfocused divs/spans, or something equivalent.

But reading the offOpacity from the theme would already be quite useful.

@mhartington
Copy link
Contributor Author

Since this has been implemented, I'm closing the issue

@pomber
Copy link
Owner

pomber commented Feb 5, 2020

Thanks. For the record, it's documented here (unfocused.opacity).

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

No branches or pull requests

3 participants