maxim / bootswatch-rails

Bootswatches converted to SCSS ready to use in Rails asset pipeline.
MIT License
489 stars 84 forks source link

Bootswatch 3.0 version #47

Closed rash-mi closed 10 years ago

rash-mi commented 11 years ago

Hi,

First of all, thanks so much for this project. We are using bootstrap/bootswatch in-house and we love it here.

I am working on an upgrade to version 3.0 of bootstrap. Bootswatch v 3.0 is already available but I need the .scss files . I forked/cloned this repo with a hope of creating the .scss files but I am not sure how to generate them. I followed whatever was there in the readme in this project. I am new to ruby and hardly know anything about making changes and running commands. However, if someone could provide me instructions on how to pull the bootswatch v3.0 .css files and convert them to .scss files, I would be happy to send a PR and contribute back to this project.

Thanks, Rashmi

AlanMcCann commented 10 years ago

I will be glad to help with it as well.

This project https://github.com/thomas-mcdonald/bootstrap-sass has some tools for conversion but getting some guidance from someonw familiar with the process would make sure the proper steps are followed. It sounds like Rashmi and I are willing to do whatever work is required.

rash-mi commented 10 years ago

Thanks @AlanMcCann . I surely can use some help and guidance here :)

My idea was to create a new source and destination for the bootswatch version 3.0 files so they can coexist with the earlier version 2.3.2

With my limited knowledge of ruby, I made a simple update to the src/dest path in the Rakefile. I have checked in the changes to my local repo, https://github.com/rash-mi/bootswatch-rails and all converted files are at "/vendor/assets/stylesheets/bootswatch3/" . (Commit id is c4a29f33c841c30836263a593739c528fef9ecfe)

I have copied the entire source "/bootswatch3" directory. Probably not a clean way to do this, but I was eager to try this conversion, so I went ahead with it in my repo. I definitely would not want to include this in a PR.

Could you let me know if you find anything amiss please?

maxim commented 10 years ago

@AlanMcCann @rash-mi Thanks a lot for positive feedback. As you may've noticed, I'm not keeping up too well with maintaining this project, and would love some help. Unfortunately if we just convert files from less to scss by hand, it's even harder to keep up. That's why I wrote an automated converter script, which you can find in the root of the repo.

The converter is not perfect, and some things still have to be done by hand, but it helps quite a bit, and it would probably make sense to do everything with it. That means knowing ruby.

I also wrote a rearranges script (also in root of repo) which shows you if the order of defined variables is wrong, and they need to be rearranged. In less you could use variables before defining them, but not in scss.

And then there is the submodule which points at the exact commit of bootswatch repo which the source less files were taken from. That submodule pointer is meant to be updated every time you update scss themes.

So keeping the converter script operational, and updating it with new rules seems to be the only way to have any hopes for this project to last. Let me know your thoughts.

AlanMcCann commented 10 years ago

I will take a look at the converter within the next day or so and see how it works for me and if I can fix anything that pops up.

daveharris commented 10 years ago

Hi @AlanMcCann.

How did you get on with using the converter and rearranges script? I am willing to help out where I can but I'm having trouble following what work has already been done (ie. has c4a29f33c841c30836263a593739c528fef9ecfe been converted by hand or what?)

What is the update process? Do we need to import that latest version of thomas-mcdonald/bootstrap-sass and then run those scripts and fix any issues or what?

Just trying to get a grip of what work has been done and what I can do.

Thanks, Dave

AlanMcCann commented 10 years ago

Hi @daveharris, I had started but life/work intervened and haven't been able to work on it.

I made one change to the "rearranges" file - the line "unless assignment.nil?" to make it work without an error.

moves = []
unassigned.each do |variable|
  assignment = assigned.find{|v| v == variable}
  unless assignment.nil?
    moves << [
      [ variable.section_name,
        variable.section_header,
        variable.section,
        variable ],
      [ assignment.section_name,
        assignment.section_header,
        assignment.section,
        assignment ]
    ]
  end
end

I ran a test but then ran out of time looking at either manually fixing the output to make sure the variables were declared before use. I also ran into another error that I can't remember.

I'm available to help with testing but have very limited time for concentrated efforts to rework the code for the coming timeframe.

Note: I haven't created any pull requests for the above.

Alan

maxim commented 10 years ago

@daveharris @AlanMcCann I'm here to help if you have any questions. I originally wrote the rearranges script with the intention to automatically rearrange all the variables. Then I decided that it's not very reliable and too complex, for now, so I left it as a "show me what to rearrange" script, rather than actually doing the job. I'm totally open to any different or better approach to this whole scss conversion issue. Perhaps if enough people are involved, everything can be converted by hand continuously. I just feel that right now we must resort to scripts to have any hope of keeping up. Unfortunately I myself haven't been using bootswatches in a while and so haven't been able to keep this project going, but let me know if I can help with anything.

maxim commented 10 years ago

@daveharris @AlanMcCann I added CONTRIBUTING.md to explain the ways to contribute. Hope it's helpful. I'm open to any suggestions.

daveharris commented 10 years ago

Hi @AlanMcCann and @maxim, Thanks for your help with this, I will hopefully get some time this week to start digging through this. I am rails developer in New Zealand so hopefully I can make some useful to the rearranges script to make it work with Bootstrap 3.

I'll let you know if I run into any issues (I presume I will!!)

Dave

paul-english commented 10 years ago

I don't know the status of the fork @rash-mi has, but here is a seemingly correct conversion that I'm using in my work.

rash-mi commented 10 years ago

Hi @log0ymxm, Sorry for the late reply.

I used the existing ver 2.3.2 scripts with some minor changes(after forking from the main repo) to path, etc. But I am not ruby proficient and I could not find any time to get back to working on this. So unsure about the extent of my changes though I should say, I was able to bring up my test app then.

But it Looks like your PR achieves what is needed. Thanks.