Reputation: 23
I'm struggling to properly install and configure Semantic-UI using bower in my Rails 4 app. Until now, here's what I've done:
Gemfile:
gem "less-rails"
gem "therubyracer"
.bowerrc file:
{
"directory": "vendor/assets/components"
}
bower.json:
{
"name": "app",
"version": "0.0.0",
"homepage": "myapp.com",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"vendor/assets/components",
"test",
"tests"
],
"dependencies": {
"semantic-ui": "~1.12.2"
}
}
After bower install, semantic UI gets properly pulled into my /vendor/assets/components folder
Now, I'd like to take advantage of semantic's theming properties, without of course editing what's currently loaded by bower.
I've added the following in semantic.css.less, itself being required in application.css
@import "semantic-ui/src/semantic";
The issue now: semantic lib seems to be properly fetched in the proper folder, as I get the following error:
'site//globals/site.variables' wasn't found Ok I understand that.
But how do I use custom configuration files with the default assets installed by bower without touching these ? How can I properly create the required configuration files (theme.config / site.variables / site.overrides), out of my /vendor/assets/components folder, and still properly assigning the SASS variables required for the lib to compile ?
Upvotes: 2
Views: 878
Reputation: 26
I would take a gander at less-rails-semantic-ui, this is what I ended up going for my new rails project. It properly adds all the override files in vendor/assets!
Upvotes: 1
Reputation: 91
If you are using less source files without npm (which includes an installer), you will need to manually create theme.config from theme.config.example and site/ from _site/ this is to avoid upstream changes affecting your local ui. https://github.com/Semantic-Org/Semantic-UI/tree/master/src#config-files
PS: from the owner answer, source: https://github.com/Semantic-Org/Semantic-UI/issues/2239
Upvotes: 1