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
CSSPlugin missing #18
Comments
Hi and thanks for your interest in this module. CSSPlugin
nuxt.config.js export default {
buildModules: ['nuxt-gsap-module']
} Available globally // Access GSAP by using
this.$gsap
// or
const gsap = this.$gsap
gsap.to('.box', { rotation: 27, x: 100, duration: 1 }) CSSRulePlugin
However, nuxt.config.js export default {
buildModules: ['nuxt-gsap-module'],
gsap: {
extraPlugins: {
cssRule: true
}
}
} Available globally // Access the plugin by using
this.$CSSRulePlugin
// or
const CSSRulePlugin = this.$CSSRulePlugin
// or
const gsap = this.$gsap
const rule = this.$CSSRulePlugin.getRule('.myClass::before') //get the rule
gsap.to(rule, { duration: 3, cssRule: { color: 'blue' } }) Feel free to try it and let me know if everything works as expected. |
Closing this as resolved, but feel free to reopen it if you have any issues. |
Hi @ivodolenc, thanks for your quick reply … and sorry for re-opening this issue, but I’m still not able to get it to work. :/ Maybe this sandbox helps: https://codesandbox.io/s/cssruleplugin-qrhzx?file=/pages/index.vue Did I miss something, because the getRule function returns undefined? |
Hi, @P-at, Try removing the <template>
<div class="box"></div>
</template>
<script>
export default {
mounted() {
const circle = this.$CSSRulePlugin.getRule('.box::after')
// works as expected
console.log(this.$CSSRulePlugin);
console.log(circle);
this.$gsap.to(circle, { duration: 5, cssRule: { backgroundColor: 'blue' } })
}
}
</script>
<style>
.box {
position: relative;
width: 10vw;
height: 10vw;
border: 1px solid #000;
}
.box::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 5vw;
height: 5vw;
background: #000;
border-radius: 50%;
}
</style> |
Ouch, good to know! 🙈 Appreciate your help. Thanks again! |
No problem, but yeah, strange behavior. I think this has to do with the way Also thanks for ☕ Cheers 👋 |
Hi @ivodolenc,
first of all, thank you for this great module. It’s pretty handy!
The current version is missing the CSSPlugin (CSSRule doesn’t work without it).
Would you be so kind and integrate it?
Thank’s in advance!
The text was updated successfully, but these errors were encountered: