简体   繁体   English

如何在 nuxt.js 中更改 vue-intro.js css

[英]how to change the vue-intro.js css in nuxt.js

I'm trying to change the CSS feature vue-intro tutorial for my web app.我正在尝试为我的 web 应用程序更改 CSS 功能 vue-intro 教程。 I'm having trouble with how to change the tooltip button color, themes in vue-intro.js.我在如何更改 vue-intro.js 中的工具提示按钮颜色和主题时遇到问题。
在此处输入图像描述

I want to change Next button color.我想更改下一个按钮的颜色。 so, how to change CSS in nuxt.js project.那么,如何在 nuxt.js 项目中更改 CSS。

I added the below code as a plugin.我将以下代码添加为插件。 but I can't change the CSS但我无法更改 CSS

import Vue from 'vue'
import VueIntro from 'vue-introjs'
import 'intro.js/introjs.css'


Vue.use(VueIntro)

Here's an SCSS utility to generate the CSS for it:这是一个 SCSS 实用程序,用于为其生成 CSS:

$btn-color: #f50;
$text-color: white;

a.introjs-nextbutton {
  background-color: $btn-color;
  border-color: darken($btn-color, 4.2%);
  text-shadow: none;
  color: $text-color;
  &:hover {
    background-color: lighten($btn-color, 4.2%);
    border-color: $btn-color;
    color: $text-color;
  }
  &:focus {
    box-shadow: 0 0 0 0.2rem transparentize($btn-color, .42);
    background-color: $btn-color;
    border-color: darken($btn-color, 4.2%);
    color: $text-color;
  }
}

I have done something similar before.我以前做过类似的事情。 I think the only way to do it is to overwrite the className or not import the intro.css (make your own).我认为唯一的方法是覆盖 className 或不导入 intro.css (自己制作)。 You need to "inspect element" to find out the introJS className from the library.您需要“检查元素”以从库中找出 introJS 类名。 Basically their className start with prefix introjs-something.基本上他们的 className 以前缀 introjs-something 开头。 I can even do things like display none for previous button or change its color.我什至可以做一些事情,比如前一个按钮不显示或改变它的颜色。 See picture below.见下图。

Click this to see My Inspect Element to find introjs classes单击此处查看我的检查元素以查找 introjs 类

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM