LESS work-flow with Atom - less

I am trying to get Atom to work with LESS and I can't find the correct way.
This is my folder structure:
/css/main.less
/css/partials/base.less
/css/partials/forms.less
...
I want to build main.less every time I save a partial but not build the partial itself. How can I do that? I think I tried all packages related to LESS and none of them solved my problem.

Ok, I found why I wasn't able to make it work.
I am using the package atom-less which I tried before. The only thing I did different is restarting Atom after package installation.
Following the instructions of the package is enough to make it work. In my case:
comment on the first line of main.less:
// "out": "main.css", "sourcemap": false, "compress": true, "autoprefixer": false
comment on the first line of one partial:
// "main": "../main.less"

Related

What does two version requirements on single line mean in a package-lock.json?

I was looking through my package-lock.json and I came across this requirement:
"requires": {
"bootstrap": ">=4.5.3 <5.0.0",
}
What does it mean to have two version expressions in one line like this?
I'm writing something to compare package versions and I don't know how to interpret it.
In the context of a package requirement, "bootstrap": ">=4.5.3 <5.0.0" means that the package requires a version of bootstrap that is greater than or equal to 4.5.3 and less than 5.0.0. In this context it would function the same as ^4.5.3 but you could use this functionality to specify a larger range if needed. Eg: "bootstrap": ">=4.5.3 <5.3.7" which would make the package compatible with any version of bootstrap from 4.5.3 up to (but not including) 5.3.7.

Magento 2 API removes spaces within variables

I am working with orders and invoices.
I noticed M2 (2.4.4) removes lots of spaces in almost all variables eg. for:
order['billing_address']:
'city': 'CHAMPIGNYSURMARNE'
In backend, it's well written 'CHAMPIGNY SUR MARNE'
Idem for :
order['billing_address']
'additional_information': [
'Virementbancaire',
'Votrecommandeseraexpédiéelorsquelevirementdesonmontantseraconfirméparnotreorganismebancaire.\r\nVoustrouvereznoscoordonnéesbancairesdanslaconfirmationdecommandeenvoyéesurvotreboîteemail.'
],
I also noticed that issue doesn't happen in all variables. Even if for the time, I can only see ONE value on witch it doesn't happen :
order['status_histories']
'comment': "Remboursement de 6,00\xa0€ hors ligne. <span style='color:deeppink'>(By Axel B)</span>",
Did anyone else ever noticed this ?
My bad ! I post this answer because maybe, somebody one day could be as dizzy as me.
The reason is I use a new tool for formatting - among others - JSON and XML.
I recommend it to those who do not know it yet : DevToys (Mac an Win).
But it is responsible for my misfortunes because is't it that removes spaces when beautifying. As the file was long, I didn't even have a look a the row file. I've searched in the soft an option that could avoid this behaviour ... without success.

Laravel - Bootstrap - NPM Watch is not replacing css matches, it's adding

Laravel 8 - Bootstrap 4
I have two Laravel projects. One created and running in docker, the other created and running in Vagrant/Homestead. The setups are almost the same otherwise.
However, in my vagrant/homestead project, when I use variables in my app.scss file like these:
$theme-colors: (
"blue": #007bff,
"indigo": #4B0082,
"purple": #6d388c,
"pink": #e83e8c,
);
What compiles into my app.css file, is duplicated for the items above, like this:
:root {
--blue: #3490dc;
--indigo: #6574cd;
--purple: #9561e2;
--pink: #f66d9b;
--blue: #007bff;
--indigo: #4B0082;
--purple: #6d388c;
--pink: #e83e8c;
}
With my colors lower in the file. The end result is the same, as the lower variables take precedence, and they aren't double processed into the classes where they are included either.
It seems something is wrong, as this does not happen in my project on the docker install. Is it possible that the mixin (or...) rules changed to now include the duplicates? Hard to guess that is true.
I don't believe docker or vagrant has anything to do with this, I'm just using those specifics to keep clear which is which.
Any ideas? Thanks.

Module dependencies: is it possible to set a mininum version?

Is it possible to add a minimum version to a module listed in the depend section of a META6.json file?
It uses the same syntax as the Version class. You can use, for instance, v1.0+, or, in META6.json, simply "1.0+"
To declare a dependency on Foo of version 1 or higher one would do the same as if one was asking zef to install Foo:ver<1.0+>:
zef install "Foo:ver<1.0+>"
"depends" : [
"Foo:ver<1.0+>"
]
Long form identities use version literals for api and ver attributes, and strings for any other (such as auth, file, name, etc). So to describe such a dependency you should write it the same way you would if you were useing it using the literal form :foo<...> ala use Test:ver<6.d+>. This is opposed to :foo(...) form which can run anything, e.g. use Test:ver(do { say 42; v6.d+ }), which would allow arbitrary code execution by just searching for dependencies and thus is not a valid way to describe something in a META6.json

Lua - Question on modules

Say I want to make a module for say a set of GUI controls, how would I create a module that would load all of the GUI scripts, and should I put those scripts as modules themselves? I was thinking of having a system like this:
module("bgui", package.seeall)
dofile("modules/bgui/control.lua")
dofile("modules/bgui/container.lua")
dofile("modules/bgui/screenmanager.lua")
dofile("modules/bgui/form.lua")
dofile("modules/bgui/button.lua")
dofile("modules/bgui/textbox.lua")
dofile("modules/bgui/label.lua")
Would all the files run then have the variables they set as part of the bgui module?
Aka if in control.lua I had control = {...} would it be defined as bgui.control or should I make the control.lua a module itself, something like module("bgui.control") would that work as I intend?
Sorry if this isn't very clear had to write it in a rush, thanks :)
You are actually asking two questions here:
First, "is this way of loading lots of files on a module ok?"
The answer is - yes. It is kind of an unspoken standard to call that file mymodule/init.lua. Most people have ?/init.lua included on their path, so you can just write require('modules/bgui') and init.lua will be loaded automatically.
This said, you might want to remove some code duplication by using a temp table and a loop:
# modules/bgui/init.lua
local files = {
'control', 'container', 'screenmanager', 'form', 'button', 'textbox', 'label'
}
for _,file in ipairs(files) do dofile("modules/bgui/" .. file .. ".lua") end
Second, "are objects defined on one file available on bgui?".
The answer is also yes, as long as the file defining the variable is "done" (with dofile or require) before the file using the variable.