-
Notifications
You must be signed in to change notification settings - Fork 3.4k
@declare: importing a less file without outputing #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
First, I would suggest if you have page1.less, page2.less, ..., page100.less then that sounds a bit like a CSS organization problem which LESS can't fully solve. More class abstraction might lessen the load per page. That aside, you can soon do this:
That will allow you to use any variables / mixins in global.less, but will not output any CSS classes within global.less. This feature is enabled in (I should know this, but don't off the top of my head) 1.4.0 or 1.4.1. |
Thanks, Two questions:
|
Are there no elements within those 20-30 views that could be abstracted into a higher order library? If so, then how many unique characteristics per view are there? If each view only has a few differences, why not simply have a single less file that is responsible for handling those differences. (The following assumes you have some sort of unique ID set in the body): // USERS
#users {
.call-to-action {
font-size: 5em;
}
}
// THANK YOU
#thankyou {
.back {
font-weight: normal;
}
} |
Its in 1.4.1 - on the 1.4.1 wip branch. I really want to get some stuff released but I don't have time. I want to release 1.4.0 and then put 1.4.1 onto npm as an alpha. you can download the repository from the 1.4.1 branch and just use it for now, if you want. |
From a deployment prospective Releasing should be one command line command using the I understand that releasing implies also release note and updating of documentation. |
Yeah maybe one of us could put 1.4.1-wip on npm as well, but I want @lukeapage's thoughts on doing so first. I'm reading Luke's response to mean that he would like to wait, and I'm supportive of that if that's the case. Primarily because although it might be more convenient for folks to pull it down with npm, it's also more likely to result in new Issues on the Less.js repo before we've even officially launched 1.4.0. Anyway, this is a judgement call for Luke to make. |
IMHO there is something off here about how revision number are used:
Wikipedia explains it better than me : http://en.wikipedia.org/wiki/Software_versioning I would also make sure that you test releases against popular projects using less.js (ex: Twitter bootstrap) |
This original issue posted here wasn't about versioning philosophies. Please search the issues so we don't have to keep rehashing the same conversation. |
I searched for "revision" and "version". I scanned through the results and I found a few discussions about when to publish on npm and what to keep or not in the repo. I am glad you are having this kind of conversations. However I haven't find anything that make explicit less' versioning policy or why the new version with new features is 1.4.1 instead of 1.5. |
@ChrisCinelli In general, what you're saying is not off-base. Versioning is typically done in the way you describe. So, I agree. 1.4.1 should be 1.5.0 minimally; however, 1.4.0 should have been 2.0.0. As a team, we are in agreement about that now and are adjusting course moving forward. But, for the time being, we've left version numbers as they are and will make that course correction starting with 2.0. There's might be an opportunity to rename 1.4.1 as 1.5.0; we could look into that. |
Agreed, I was just saying I think we've had the discussion several times on here. But... to your point those conversations probably aren't tagged as such, so my comment was probably unfair. apologies. |
I'm happy to rename 1.4.1 to 1.5.0.. I'll do that.. would rather stick to a normal convention for version numbers from now on. I haven't put 1.4.1 (read 1.5.0) on npm because it is not feature frozen.. though I may put the pulls in and then move everything with milestone 1.4.1 to 2.0 @ChrisCinelli with the alphas/betas we did for 1.4.0, alpha was "almost feature complete", beta was "feature complete, just accepting bug fixes" we do this in our spare time and I spend enough of my day job worrying about things like this, so when it comes to less I mainly do the bits I find fun (e.g. the coding/bugfixing). You are more than welcome to join us and help us keep to correct version numbers |
I'm good with either. Let's just all get on the same page |
Regarding versioning, I am not too familiar with Glad to see things moving forward... two years ago when cloudhead was extremely unresponsive and nobody else was working on less, I thought the project was destined to a early dead. I am happy to help out with the time I can spend on this. From the commit history it looks like you do not use a lot the fork workflow but you are mostly giving people the right to commit on the "official" cloudhead's repo. Am I wrong? If you give me commits right I will try to put some work into it. |
you can tag a release and if you do that it won't be installed by What is the fork workflow? I'm pretty much the only person committing to the repo at the moment. Its just I prefer rebasing peoples commits than merging them in. To give you commit rights we at the moment have to get @cloudhead to add you.. we do plan on eventually moving to a less organisation though, where we will have more control. To save giving too many people commit rights I would probably suggest you do something via a fork and then a pull request.. if you pick up an issue with some disagreement on it, please shout about it first, otherwise you risk implementing a feature we don't want. Assuming you do a good pull request and still want it, we will then give you higher priviliges.. does that sound fair? I don't want to put you off, but I also don't want us handing out commit rights like candy.. |
I tried |
I answer my own question after digging in the code. Yes, it is in the 1.5.0 branch. I hope it will be released sooner than later. Thank you for the hard work! |
I hope to release a beta in the next week or so. You can install from npm |
Use case:
How do you make sure that everything works as expected?
I have 4 choices:
pageSpecific.less
that has a@import 'global.less'
. The cons are:global.less
file that has include topage1.less
,page2.less
, ... ,page100.less
.global.less
and you have two LESS files for each page:global.less
andpageSpecific.less
. This does not work for me.@declare
directive, we could have two files in the page:global.less
andpageSpecific.less
.pageSpecific.less
will have@declare 'global.less'
.The result will be thatpageSpecific.less
will be able to use the mixins and the variables inglobal.less
but the output of the compilation ofpageSpecific.less
will not include the CSS rules already compiled inglobal.less
. In this way we will have the optimal use of bandwidth and quick transfers.The text was updated successfully, but these errors were encountered: