0

I am unsure if this is possible but I hope so.

I have an element with a translation transform, which I have no control over (it is set by an NPM package that I am using). I would like to set a scale transform on that element and be able to retain whatever transform the element already has, like a concatenation.

Imagine that this is similar to what I want to achieve:

transform: +scale(1.01);

Is this doable, and if so, how?

2 Answers 2

1

As far as I know that isn't really possible, so you have two options.

  1. You can find the definition in the package for that transformation, copy it to your CSS, then add your desired changes to it.

or

  1. You can place the element inside a parent element that has your desired transformation on it, that way both work.
Sign up to request clarification or add additional context in comments.

2 Comments

I had to resort to a parent element. Though it did not look like I wanted, it will have to do.
@Christoffer if you want to make a more specific question with your specific case in it I might be able to help, sorry if this wasn't what you were looking for
0

Look how CSS works in any HTML page is like you can import as many stylesheets but the stylesheet imported in the last can take all the priority. So, you can obviously override the CSS of that package component by knowing the class/id or if you can catch that particular element by any selector combination.

Also, if your CSS is imported earlier than that component's CSS, you can put !important on your CSS property. So, no other property value can override your CSS value.

You get my point! Don't mind if it sounds more blahblah.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.