less

Bootstrap navbar margins

被刻印的时光 ゝ 提交于 2020-06-27 08:20:15
问题 I'd like to make the left and right margins of the navbar conetnt smaller so the "brand" (left most component) appears more on the left then the default and same for the right component. Can somebody point me to relevant less variables to modify? Thanks 回答1: With a basic layout, the CSS selector you want is body > .navbar .brand Play with margin-left and margin-right until you get the result you want. Depending on how you are calling your CSS styles, you may need to add !important as well, eg

Reusing LESS nested styles

陌路散爱 提交于 2020-06-24 23:19:12
问题 Let's say that I have a style defined using Less: ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } Later on, I want to re-use the unstyled class: .my-list { .unstyled; } This doesn't work, however, and I can't figure out the magic to make it work. Any thoughts? 回答1: You can't re-use arbitrary class definitions, only mixins (those starting with a dot). In this case you'll need to duplicate it. 回答2: Try this: .unstyled { margin-left: 0; list-style: none; } .my-list { .unstyled; }

How to style bootstrap col-lg-* classes?

岁酱吖の 提交于 2020-05-10 04:43:49
问题 I'm beginner in Less. I want to write a string like "Column-div" in any div with col-lg-[anyNumber] or col-md-[anyNumber] class. For example something like this code: .col-lg-*:before { content: "Column-div"; color: #28a4c9; } How can I do this with Less? 回答1: With Less: One of the options would be to basically create a Less loop like in the below code sample. However, the problem is that the number is fixed and so it would (a) statically generate as many classes as the number (which means

How to style bootstrap col-lg-* classes?

强颜欢笑 提交于 2020-05-10 04:43:06
问题 I'm beginner in Less. I want to write a string like "Column-div" in any div with col-lg-[anyNumber] or col-md-[anyNumber] class. For example something like this code: .col-lg-*:before { content: "Column-div"; color: #28a4c9; } How can I do this with Less? 回答1: With Less: One of the options would be to basically create a Less loop like in the below code sample. However, the problem is that the number is fixed and so it would (a) statically generate as many classes as the number (which means

Is it possible to call a javascript function with less variable from less css?

落爺英雄遲暮 提交于 2020-05-09 06:54:46
问题 I have to call a javascript function from the less css for customization purpose. The function needs to pass the less variable from less file to js. is it possible to do it? using backtick can get js variable in less file but I don't know how to call a js function from less? demo.js function getGradient(colorlist, dark, light){ // some large customization } demo.less @color: #ffffff,#000000,#cccccc; @light: 20%; @dark: 50%; @gradient : ~`getGradient(@{color}, @{light}, @{dark})`; The above

How to change CSS according to user Operating System

♀尐吖头ヾ 提交于 2020-05-08 16:16:26
问题 How can i write CSS that handle a different effect on Mac OS and different on other OS versions. i.e. .(mac){ height: 100%; width: 100%; overflow: hidden; } .(win and linux){ height: 100%; width: 100%; overflow: scroll; } 回答1: You cannot do this with pure CSS, you can detect OS like MAX or WIN with JavaScript, and then use that to load different CSS styles. You can use the result of window.navigator to find information about the OS. console.log(window.navigator); 来源: https://stackoverflow.com