stylus

How to use several next.js plugins (typescript and stylus)

落花浮王杯 提交于 2019-12-11 02:25:19
问题 I try to build next.js project with typescript and stylus using next-compose-plugins. My next.config.js: const withPlugins = require('next-compose-plugins') const withTypescript = require('@zeit/next-typescript') const withStylus = require('@zeit/next-stylus') module.exports = withPlugins([ [withTypescript, { webpack(config, options) { config.node = { fs: 'empty', } return config }, typescriptLoaderOptions: { transpileOnly: false, } }], [withStylus, { cssModules: true, }], ]) In my button.tsx

can't use Hashes from Stylus

こ雲淡風輕ζ 提交于 2019-12-10 22:54:06
问题 I read http://learnboost.github.io/stylus/docs/hashes.html and none of the examples not working for me. For exapmle foo = { bar: { baz: { raz: 10px } } } qux = "raz" padding padding foo["bar"].baz[qux] a compilation error expected "indent", got "eos" What did I do wrong? 回答1: You should use colon when calling hashes' values, as otherwise Stylus couldn't differentiate between selectors and hashes. So, foo = { bar: { baz: { raz: 10px } } } qux = "raz" padding padding: foo["bar"].baz[qux] should

grunt watch and stylus

拈花ヽ惹草 提交于 2019-12-10 21:59:08
问题 can't figure how nesting grunt watch and stylus compiler (livereload will come later) I tried also using the "new" grunt newer, but there must be something wrong in my code. Any suggestion? grunt.initConfig({ stylus: { compile: { options: { paths: ['stylus'], import: [ 'nib/*' ] }, files: { 'css/style.css': 'stylus/style.styl', }, }, }, watch: { stylus: { files: ['*/*.*'], task: ['newer:stylus:compile'], options : { livereload: true }, }, }, }); grunt.loadNpmTasks('grunt-contrib-stylus');

在vue项目中引入stylus

不打扰是莪最后的温柔 提交于 2019-12-09 16:13:36
安装stylus 在项目文件夹中打开git bash,然后在黑框中输入npm install stylus stylus-loader。 在项目中创建 stylus 文件 在css文件夹下创建stylus文件,格式为 文件名.styl ,然后在文件上写代码。 在vue组件中引入stylus文件 如上图,在style标签里面输入 lang=“stylus”。因为是在style标签下引入文件,所以要使用 @import ’ 路径 ’ 这方法来引入,其中~@指代的是src。 来源: CSDN 作者: weixin_39559640 链接: https://blog.csdn.net/weixin_39559640/article/details/100712205

Unable to override styles in vuetify

a 夏天 提交于 2019-12-08 05:06:47
问题 how can I overwrite actual classes in vuetify? I have created a ./src/stylus/main.styl file where I override some of the current vuetify settings as a test: @import '~vuetify/src/stylus/settings/_variables' @import '~vuetify/src/stylus/elements/_typography' $material-dark.background = green $body-font-family = Arial $alert-font-size = 18px .display-2 font-size: $headings.h6.size !important font-family: $headings.h3.font-family !important @import '~vuetify/src/stylus/main' For some reason the

Can I use Stylus and/or Jade with Spring 4 MVC project?

喜欢而已 提交于 2019-12-08 04:13:42
问题 I have gotten used to/fell in love with Stylus for preprocessing css and Jade for simplifying my HTML in the Node.JS world. Now I am back to working on a Spring 4 MVC project and would like to use those technologies in this environment. Is it possible to integrate them (I am using Gradle)? A quick google search for Stylus Java Gradle returned no helpful responses. Thanks! 回答1: Stylus and Jade seem to be popular in the JavaScript world, not so much in the JVM world. Here are the closest tools

How to Generate Placeholders in Stylus

女生的网名这么多〃 提交于 2019-12-08 03:14:56
问题 I'm looking to generate placeholders and variables that can change depending on configured proportions such as the following: $small-margin-top $large-margin-top $small-padding-bottom Where each placeholder applies the corresponding, generated variable to the rule: $small-margin-top margin-top $marginsmall $large-margin-top margin-top $marginLarge $small-padding-bottom margin-bottom $marginSmall I have statically defined the variables for now: /* Margin */ $margin = 1rem $marginsmall =

如何在移动端设置1px的border

帅比萌擦擦* 提交于 2019-12-08 01:55:06
在这里我只介绍下边框的实现: 实现原理:伪类+缩放 工具:stylus预编译器 1、在 stylus文件夹中创建mixin.styl文件,内容如下:(即通过伪类+子绝父相 实现1px的下边框,这只是开始,并没有结束 ) border-1px($color) position: relative &:after display: block position: absolute left: 0 bottom: 0 width: 100% border-top:1px solid $color content: ' ' 2、在 stylus文件夹中创建base.styl文件,内容如下:(根据设备的dpr确定y轴的缩放比例) @media (-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5) .border-1px &::after -webkit-transform: scaleY(0.7) transform: scaleY(0.7) @media (-webkit-min-device-pixel-ratio: 2),(min-device-pixel-ratio: 2) .border-1px &::after -webkit-transform: scaleY(0.5) transform:

CSS Media Queries and My Nexus One (Or other Android phones)

99封情书 提交于 2019-12-08 00:37:24
问题 So I have 2 phones an Android Nexus One and a cheap simple Android device I bought for like $100 retail. I am trying to make my website mobile device friendly using @media and CSS (I am actually using stylus and Node.JS so the code may look a bit funny). So I added the following to my style //trial 1 @media (max-width:480px) display none //Trial 2 @media (resolution: 163dpi) display none //Trial 3 @media (-webkit-device-pixel-ratio:0.75) display none //Trial 4 @media screen and (max-width

一个vue项目的搭建流程

感情迁移 提交于 2019-12-07 23:48:25
常用技术栈的安装 stylus: [cnpm install stylus -g]+[cnpm install stylus stylus-loader --save-dev] element-ui: [cnpm install element-ui --save] import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' axios: [npm install axios -save] axios封装: https://www.jianshu.com/p/1209bc39b3ae 来源: https://www.cnblogs.com/zhongdabo/p/12004021.html