Sass

SCSS file imports using ~ (tilde) is not working in Angular 6

半腔热情 提交于 2020-08-06 15:39:10
问题 I have two question regarding scss file imports in Angular6 Do I need to import my partials in all of my component.scss files after having imported it once in global src/sass/styles.scss . Shouldn't importing it once be enough? How do I import SCSS partials using import shortcut ~ ? All my partials are contained in src/sass folder. This is fine: @import '../sass/variables';//in app.component.scss But this throws error: @import '~sass/variables' : ERROR in ./src/app/app.component.scss Module

GitHub Pages 与 Gitee Pages 上的 Jekyll

橙三吉。 提交于 2020-08-05 05:14:22
目录 Jekyll on GitHub Pages Jekyll 的 Markdown 引擎 常规插件 静默增强插件 GitHub Pages 主题 总结 Jekyll on Gitee Pages GitHub 与 Gitee 提供的 Pages 服务中,均内嵌了 Jekyll 支持(Gitee 还提供了 Hugo 与 Hexo 支持)。所谓「支持」,即指这些生成工具挂在云端;你只需要提供原始代码(如 Markdown 文档、Sass/Stylus/Less 样式表),再由 Pages 服务自动编译、部署即可。这样,搭建网站的技术门槛进一步下降,你只需要会两件事就能搭建网站了: 会写 Markdown 文档; 注册 GitHub 或 Gitee 账号,点点鼠标,在你的代码仓库中启用 Pages 服务。 因为技术门槛如此之低,导致不少用户压根就意识不到 Pages 服务内置了 Jekyll 工具,甚至以为每一个 Markdown 文档理所当然地就能变成一个网页。此外,另一个常被忽视的问题是:由 Pages 服务调用的 Jekyll 工具,并非最新版本,而且隐性地增添了许多插件,这可能使用户在本地使用 Jekyll 或迁移平台时碰上「不协调」的问题。最常见的一个问题就是:在 GitHub Pages 上正常生成的代码仓库,到 Gitee Pages 上就变得一团糟。这不是因为

CSS calc()函数中的Sass变量

我们两清 提交于 2020-08-04 21:15:51
问题: I'm trying to use the calc() function in a Sass stylesheet, but I'm having some issues. 我正在尝试在Sass样式表中使用 calc() 函数,但是遇到了一些问题。 Here's my code: 这是我的代码: $body_padding: 50px body padding-top: $body_padding height: calc(100% - $body_padding) If I use the literal 50px instead of my body_padding variable, I get exactly what I want. 如果我使用文字 50px 而不是我的 body_padding 变量,那么我得到的正是我想要的。 However, when I switch to the variable, this is the output: 但是,当我切换到变量时,这是输出: body { padding-top: 50px; height: calc(100% - $body_padding); } How can I get Sass to recognize that it needs to replace the variable within

how to get env variable in scss

天涯浪子 提交于 2020-08-04 14:12:46
问题 I want to get one env variable data in my scss file by using mix in Laravel. How to get that? I have used something like this. But this one is a URL, so, it is not getting. mix.sass('resources/assets/sass/main-v2.scss', 'public/css', { data: `awsUrl: "${(process.env.MIX_AWS_S3_CDN)}" ;` }) 回答1: There is a simple way to do it. Follow steps as below, Correct me if wrong, you want to pass an URL to main-v2.scss file as a variable. Add a variable in your .env file as below, MIX_AWS_URL='https:/

how to get env variable in scss

▼魔方 西西 提交于 2020-08-04 14:12:01
问题 I want to get one env variable data in my scss file by using mix in Laravel. How to get that? I have used something like this. But this one is a URL, so, it is not getting. mix.sass('resources/assets/sass/main-v2.scss', 'public/css', { data: `awsUrl: "${(process.env.MIX_AWS_S3_CDN)}" ;` }) 回答1: There is a simple way to do it. Follow steps as below, Correct me if wrong, you want to pass an URL to main-v2.scss file as a variable. Add a variable in your .env file as below, MIX_AWS_URL='https:/

scss prepend selector to current selector

谁说胖子不能爱 提交于 2020-08-02 08:44:21
问题 Is there a way to prepend a selector directly to the current selector in scss. Consider the following: .object-fit { object-fit: cover; height: 100%; width: 100%; overflow: hidden; } is there a way to prepend img so that the output is img.object-fit ? The only way I have seen for prepending is to add & after like so: .object-fit { img & { } } but this would turn it into a parent child selector: img .object-fit The normal way would be just to append the second selector with &img but as this

scss prepend selector to current selector

你。 提交于 2020-08-02 08:43:06
问题 Is there a way to prepend a selector directly to the current selector in scss. Consider the following: .object-fit { object-fit: cover; height: 100%; width: 100%; overflow: hidden; } is there a way to prepend img so that the output is img.object-fit ? The only way I have seen for prepending is to add & after like so: .object-fit { img & { } } but this would turn it into a parent child selector: img .object-fit The normal way would be just to append the second selector with &img but as this

scss prepend selector to current selector

我与影子孤独终老i 提交于 2020-08-02 08:41:07
问题 Is there a way to prepend a selector directly to the current selector in scss. Consider the following: .object-fit { object-fit: cover; height: 100%; width: 100%; overflow: hidden; } is there a way to prepend img so that the output is img.object-fit ? The only way I have seen for prepending is to add & after like so: .object-fit { img & { } } but this would turn it into a parent child selector: img .object-fit The normal way would be just to append the second selector with &img but as this

Create Github mirror in Artifactory

喜欢而已 提交于 2020-08-02 07:33:48
问题 How to create a github mirror in Artifactory. We need to install node-sass . We have a remote npm repository which downloads node-sass but at the end it needs some binding.node file which comes from github. Here the build fails due to proxy. We created a remote repository to https://npm.taobao.org/mirrors/node-sass and told our build to check our remote repo for node-sass: SASS_BINARY_SITE=https://xx/artifactory/node-sass/ This works fine. But now we are mirroring a mirror. We want to mirror

Create Github mirror in Artifactory

隐身守侯 提交于 2020-08-02 07:32:28
问题 How to create a github mirror in Artifactory. We need to install node-sass . We have a remote npm repository which downloads node-sass but at the end it needs some binding.node file which comes from github. Here the build fails due to proxy. We created a remote repository to https://npm.taobao.org/mirrors/node-sass and told our build to check our remote repo for node-sass: SASS_BINARY_SITE=https://xx/artifactory/node-sass/ This works fine. But now we are mirroring a mirror. We want to mirror