首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何单独安装和导入bulma扩展(例如,bulma-工具提示)。为了正常运作,我们应该在哪里做进口?

如何单独安装和导入bulma扩展(例如,bulma-工具提示)。为了正常运作,我们应该在哪里做进口?
EN

Stack Overflow用户
提问于 2020-03-25 10:44:23
回答 2查看 2K关注 0票数 1
代码语言:javascript
运行
复制
<div class="column">
  <button class="button is-primary has-tooltip-multiline" data-tooltip="Tooltip with a long Text. So we use has-tooltip-multiline modifier to force multiline display.">Multiline Tooltip</button>
</div>

Under _sass/main.scss:

代码语言:javascript
运行
复制
@import "../node_modules/bulma/bulma";

@import "bulma/sass/utilities/_all.sass";
@import "bulma/sass/grid/columns.sass";

@import 'bulma';
@import '~bulma-tooltip';

我加了最后两行。不知道他们是否正确。

还有任何关于占线的建议..。

我已经安装了它,但不知道从哪里导入它的功能。提前感谢

EN

回答 2

Stack Overflow用户

发布于 2020-03-27 11:21:20

如果您想使用Bulma扩展,可以这样安装扩展:

代码语言:javascript
运行
复制
npm install bulma-tooltip

然后,在导入Bulma的scss文件中,您需要在导入bulma之后导入扩展名。举个例子,如果你的路径是

代码语言:javascript
运行
复制
@import "../node_modules/bulma/bulma.saas";

应按以下方式导入bulma工具提示包:

代码语言:javascript
运行
复制
// Import the complete extension
@import '../node_modules/bulma-tooltip/src/sass/index.sass';

代码语言:javascript
运行
复制
// Import only what you need from the extension
@import '../node_modules/bulma-tooltip/src/sass/_animation.sass';
@import '../node_modules/bulma-tooltip/src/sass/_responsiveness.sass';

因此,scss文件中的顺序应该是:

1)自定义sass变量

2)进口Bulma

3)进口Bulma扩展

票数 2
EN

Stack Overflow用户

发布于 2020-03-25 11:03:37

订单应该如下所示,您不需要导入完整模块

代码语言:javascript
运行
复制
// Update Bulma's global variables
$family-sans-serif: "Nunito", sans-serif;
$grey-dark: $brown;
$grey-light: $beige-light;
$primary: $purple;
$link: $pink;
$widescreen-enabled: false;
$fullhd-enabled: false;

// Update some of Bulma's component variables
$body-background-color: $beige-lighter;
$control-border-width: 2px;
$input-border-color: transparent;
$input-shadow: none;

// Import only what you need from Bulma
@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/base/_all.sass";
@import "../node_modules/bulma/sass/elements/button.sass";
@import "../node_modules/bulma/sass/elements/container.sass";
@import "../node_modules/bulma/sass/elements/title.sass";
@import "../node_modules/bulma/sass/form/_all.sass";
@import "../node_modules/bulma/sass/components/navbar.sass";
@import "../node_modules/bulma/sass/layout/hero.sass";
@import "../node_modules/bulma/sass/layout/section.sass";
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60847177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档