Skip to content

Conversation

@MYXOMOPX
Copy link

Summary

Allow to change maskTextFn: passes maskTextFn deep down to rrweb

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@lewgordon-amplitude
Copy link
Collaborator

Hey there! Thanks for the contribution. I'm implementing something related in (#756). I'd be curious if that solves what you're trying to do here?

@MYXOMOPX
Copy link
Author

@lewgordon-amplitude Hi!
Actually my idea was to change maskTextFn and check there CSS variable. If on element css-variable value is 1 (f.e. --amplitude-mask: 1) - then mask text. Else - not.
With this logic we can use amp-mask, amp-unmask classes and only last one will affect element.
So in my example I will be able to do smth like this:

<div class="amp-mask">
    <span>This text is masked</span>
    <div class="amp-unmask">
        This UNmasked
        <span class="amp-mask">Masked</span>
        <input placeholder="Unmasked input"/>
    </div>
</div>

And somewhere in CSS i will place

.amp-mask {
  --amplitude-mask: 1;
}

.amp-unmask {
  --amplitude-mask: 0;
}

Not sure that mask-levels can help in using nested mask/unmask classes. But if you will implement it - i'll be thankful

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.

2 participants