Sass

Jest and SCSS variables

橙三吉。 提交于 2020-12-12 01:07:32
问题 I'm using Jest in my project and got stuck on one test which contains SCSS variable. $grey-light: #C7C7C7; I get this Jest error: Jest encountered an unexpected token and it points on the previous mentioned line of code. 回答1: I ran into this as well and it was solved by using the identity-obj-proxy package: https://github.com/keyz/identity-obj-proxy Just follow the instructions in the Jest docs: https://jestjs.io/docs/en/webpack#mocking-css-modules And should run the tests with no issues

Can't overwrite Bulma navbar color

白昼怎懂夜的黑 提交于 2020-12-07 04:55:09
问题 I'm trying to overwrite the color of text in my Bulma navbar, it works if I'm using an !important tag in my regular SCSS files but I'm trying to use as few !important tags as possible. The Bulma docs tell me that I can overwrite the Bulma color variables, but all my attempts have been futile. What I've tried so far: Created a _bulmaTheme.scss file Tried to overwrite the colors in this file The colors do not get overwritten in the front end, I can see them further down my console as

Can't overwrite Bulma navbar color

你。 提交于 2020-12-07 04:53:45
问题 I'm trying to overwrite the color of text in my Bulma navbar, it works if I'm using an !important tag in my regular SCSS files but I'm trying to use as few !important tags as possible. The Bulma docs tell me that I can overwrite the Bulma color variables, but all my attempts have been futile. What I've tried so far: Created a _bulmaTheme.scss file Tried to overwrite the colors in this file The colors do not get overwritten in the front end, I can see them further down my console as

UniApp 从入门到开发

蓝咒 提交于 2020-12-06 09:13:34
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一、 如何创建项目 1.使用 hbuilerX 创建一个新项目 2.启动项目(微信小程序) 3.微信小程序开发者工具导入项目 (初始界面) 二、 如何编写代码 样式和sass 结构与基本语法 事件 三、 组件 四、 生命周期 常用: 应用生命周期 页面生命周期 总结 前言 首先我们要先了解什么是uni-app ? (1) uni-app是一个使用Vue.js语法来开发所有前端应用的框架( 也称之为全端开发框架 ) 技术栈:JavaScript,vue, 微信小程序, uni-app uni-app的线上作品有哪些(列举) 一、 如何创建项目 1.使用 hbuilerX 创建一个新项目 2.启动项目(微信小程序) 3.微信小程序开发者工具导入项目 (初始界面) 项目结构介绍 官方解释 二、 如何编写代码 样式和sass 支持小程序的rpx 和 h5的vw,vh。 rpx 小程序中的单位 750 rpx = 屏幕宽度 vw h5单位 100 vw = 屏幕的宽度, 100 vh = 屏幕的高度 内置sass的配置, 只需要安装对应的依赖即可 npm install sass - loader node - sass vue组件中,在style标签上加入属性 < style lang = 'scss' >

scss

心已入冬 提交于 2020-12-05 02:42:05
1.sass介绍 s ass是成熟、稳定、强大的CSS预处理器,而SCSS是Sass3版本当中引入的新语法特性,完全兼容CSS3的同时继承了Sass强大的动态功能。 2.1 css的编译模式   css ---普通   sass /scss ---高效 **   ess ---高效 2.2 sass的介绍   来源:ruby公司 基于ruby语言   基础版本,后缀名为sass 没有{} 只能通过缩进来实现 --- 可读性差,难以维护   .scss --- 可读性高,便于维护 -- 嵌套 --不用担心权重问题 2.3 如何使用scss   最终需要使用的是css文件,而编写的是scss文件   通常需要转换工具 gulp / webpack / ruby工具 /编辑器插件   这里主要使用gulp处理scss文件 3. sass的用法 3.1安装 sass 模块 安装命令 cnpm i gulp-sass -s (推荐) cnpm i gulp-sass-china -s 配置处理scss文件gulp的任务 gulp.task('scss2css', () => { // 即scss to css   gulp.src( 'scss/**/*' )     .pipe(concat( 'main.scss')) // 合并scss文件     .pipe(sass()) //

如何使用Kendo UI在Vue.js中轻松构建UI组件?

泪湿孤枕 提交于 2020-12-03 10:56:35
Kendo UI R3 2020 SP2试用版下载 本文将为大家介绍如何使用Kendo UI在Vue.js中构建一个气候视图UI组件,并完成与图表组件的界面。 首先让我们一起来了解一下背景。 什么是 Kendo UI ? Kendo UI是一个全面的Web用户界面框架,其中包含JavaScript UI组件的集合,这些JavaScript UI组件具有jQuery库以及Vue、React和Angular等更现代的库。 Kendo UI开发人员使用大量的UI小部件和数据可视化组件来构建交互式且响应迅速的高性能应用程序。 为什么选择 Kendo UI ? 使用Kendo UI,您可以轻松地将真正高级的UI组件添加到您选择库的前端项目中,不必担心接口的关键功能,而且可以节省时间,只需关注专有功能即可。 Kendo UI附带了易于使用的集成,支持您喜欢的每个前端Web框架(例如Vue.js)。 除基本的UI组件外,Kendo UI还为您提供了高级的数据可视化UI元素,可确保您不必向项目中添加其他库即可处理图表,这些高级UI元素也可自定义。 你会构建什么? 您将使用Kendo UI在Vue.js中构建气候视图UI组件,将首先使用VS Code中的Kendo UI starter扩展scaffolding,然后使用Vue Router创建路由,最后使用一些Kendo UI图表组件来构建界面。

Responsive CSS Grid with persistent aspect ratio

随声附和 提交于 2020-12-01 09:34:30
问题 My goal is to create a responsive grid with an unknown amount of items, that keep their aspect ratio at 16 : 9. Right now it looks like this: .grid { display: grid; grid-template-columns: repeat(auto-fill, 160px); grid-template-rows: 1fr; grid-gap: 20px; } .item { height: 90px; background: grey; } <div class="grid"> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div

Responsive CSS Grid with persistent aspect ratio

孤街浪徒 提交于 2020-12-01 09:33:07
问题 My goal is to create a responsive grid with an unknown amount of items, that keep their aspect ratio at 16 : 9. Right now it looks like this: .grid { display: grid; grid-template-columns: repeat(auto-fill, 160px); grid-template-rows: 1fr; grid-gap: 20px; } .item { height: 90px; background: grey; } <div class="grid"> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div

Exporting SCSS Variables to JS (auto looping variables)

折月煮酒 提交于 2020-11-30 04:57:24
问题 UPDATE : If you plan to implement the export solution, you must place it in a separate file to prevent redundant exports in your compiled CSS code. See here. I recently learned that you can export styles from SCSS into JS like so: _variables.scss :export { some-variable: 'some-value'; } app.js import styles from 'core-styles/brand/_variables.scss'; Based on this, my _variables.scss is formatted like so: /* Define all colours */ $some-color: #000; $another-color: #000; // Export the color

How to prevent fractional pixels in an element with width set to auto?

China☆狼群 提交于 2020-11-30 04:41:24
问题 I have a row of inline-block elements that all have auto width, so they draw as wide as the varying text content in each of them plus a bit of padding. This results in the actual width of each element having fractional pixels. This would be fine, but each element contains an icon font that is very sensitive to being drawn when not aligned to the pixel grid, the subpixel rendering of it just looks nasty and blurry if the glyph's origin is not at an integer pixel value. How can I keep the width