at-import / compass-extension-template Goto Github PK
View Code? Open in Web Editor NEWA generic template for creating a Compass extension
A generic template for creating a Compass extension
Hi Snugug!
I find myself using more and more SASS and Drupal stuff made by you. You're awesome!
In every Drupal theme i use a number of handy mixins that leverage Susy in a particular way. I decided to create a Compass extension to make reusing my stuff easier.
I've read documentation for compass extensions and the readme of your template. I understand how to create an extension, but i don't understand how to develop/debug it.
It's very inconvenient to recreate and redownload a gem every time i make a change to my code and want to see the result. So there should be a way to code an extension and compile a Compass project that uses the extension being developed, without assembling a gem.
Compass documentation gives a hint:
If you're developing a simple extension, you may find it convenient to place your extension within an existing compass project in the extension folder.
But i don't fully understand that. Should i create an extension
folder and put my code (i. e. your template) there? Or should i create a folder named after my extension? Or a combination of those, e. g. extension/foo
? How do i import that to a Compass project? What does the following hint really mean?
Never specify an extension in your imports as this can cause issue when the syntax of a file changes.
Dear Snugug, please clarify this. I thing you answer would be worth putting into the template's readme.
Kind regards, lolmaus
Hello, I have followed your method here to create an extension, however I can't seem to get it to register. When you type compass framework, it doesn't appear in the list.
this is the code for it in my lib/extension_name.rb file:
extension_path = File.expand_path(File.join(File.dirname(FILE), ".."))
Compass::Frameworks.register('base-framework',
:stylesheets_directory => File.join(File.dirname(FILE), '..', 'sass'),
:templates_directory => File.join(File.dirname(FILE), '..', 'templates'),
:path => extension_path)
Am I being silly here?
Hello,
I was wandering if you could help me, I have a compass extension with a project template. This template adds various files to the system including sass files, php files, js files and image files.
I want the sass files to appear within a folder called css rather than /sass that the default config.rb file puts them in when you create a project.
From a template level can you dictate the directories for your assets?:
css_dir = "css"
sass_dir = "css"
images_dir = "img"
javascripts_dir = "js"
Thanks very much for any help
How can I inject a custom hook into the config?
I have described the problem here fully: http://stackoverflow.com/questions/27315930/reuse-hooks-from-compass-config-rb
Thanks for providing this template, it clarified a lot of things! I kept having an error when I ran the gem build
command:
Invalid gemspec in [extension.gemspec]: /Users/marcelos/Projects/extension/lib/extension.rb:19: class/module name must be CONSTANT
I hadn't missed any instances of the extension name anywhere, and had tried to rebuild from scratch several times. The only thing that fixed this was commenting out lines 19-22 in /lib/extension.rb
and then explicitly defining the version and date on lines 8-9 of the extension.gemspec
file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.