Git Product home page Git Product logo

fomantic-ui-sass's Introduction

Fomantic UI for Sass

fomantic-ui-sass is an Sass-powered version of Fomantic UI and ready to drop into Rails, Compass, or Sprockets. It was forked from semantic-ui-sass to track Fomantic UI, a community fork of Semantic UI, and is intended to be a drop-in replacement. The project keeps references to Semantic UI for that reason and because Fomantic UI intends to merge back into Semantic UI once active development of Semantic begins again.

Gem Version Build Status

NOTE

The gem only has default theme.

Installation and Usage

gem 'fomantic-ui-sass'

bundle install and restart your server to make the files available through the pipeline.

fomantic-ui-sass with Rails or Sprockets

CSS

Import Semantic in an SCSS file (for example, application.css.scss) to get all of Semantic's styles

@import "semantic-ui";

You can also include modules

@import "semantic-ui/collections/menu";

Custom font

$font-url: 'http://fonts.useso.com/css?family=Lato:400,700,400italic,700italic&subset=latin';
@import 'semantic-ui';

Skip font loading

$import-google-fonts: false;
@import 'semantic-ui';

Custom font family

$font-family: 'custom-font-family';
@import 'semantic-ui';

All variables, you can custom any of that

$import-google-fonts: true !default;
$font-url: 'https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin,latin-ext' !default;
$font-name: 'Lato' !default;
$font-family: $font-name, 'Helvetica Neue', Arial, Helvetica, sans-serif !default;

Javascripts

We have a helper that includes all Semantic javascripts. Put this in your Javascript manifest (usually in application.js) to

// Loads all Semantic javascripts
//= require semantic-ui

You can also load individual modules, provided you also require any dependencies.

//= require semantic-ui/modal
//= require semantic-ui/dropdown

fomantic-ui-sass with Compass

New project

Install the gem and create a new project using the gem.

gem install fomantic-ui-sass
compass create compass-project -r fomantic-ui-sass --using semantic-ui

This will sort a few things out:

  • You'll get a starting styles.scss
  • You'll get a compiled stylesheet compiled & ready to drop into your application
  • We'll also copy the Semantic javascripts & images & fonts into their respective folders for you

Existing project

Install the gem, add the require statement to the top of your configuration file, and install the extension.

gem install fomantic-ui-sass
# In config.rb
require 'fomantic-ui-sass'
compass install semantic-ui

NOTE

When using compass, you should visit file in local server, eg http://localhost:3000/index.html, rather than file:///Users/doabit/demo/index.html

Rails Helpers

Breadcrumbs helper

Add breadcrumbs helper <%= semantic_breadcrumbs %> to your layout.

class ApplicationController
  semantic_breadcrumb :index, :root_path
end
class ExamplesController < ApplicationController
  semantic_breadcrumb :index, :examples_path

  def index
  end

  def show
    @example = Example.find params[:id]
    semantic_breadcrumb @example.name, example_path(@example)
    # semantic_breadcrumb :show, example_path(@example)
  end
end

Flash helper

Add flash helper <%= semantic_flash %> to your layout

Icon helper

semantic_icon('add')
# => <i class="add icon"></i>
semantic_icon(:add)
# => <i class="add icon"></i>
semantic_icon('add sign')
# => <i class="add sign icon"></i>
semantic_icon('add', 'sign')
# => <i class="add sign icon"></i>
semantic_icon(:add, :sign)
# => <i class="add sign icon"></i>
semantic_icon('add', id: 'id')
# => <i class="add icon" id="id"></i>

TODO

  • Add global variables
  • Add rails helpers like render_flash?

Versioning

The version for Fomantic-UI-SASS tracks the version for Fomantic-UI. The first three digits indicate the major, minor, and patch version of Fomantic-UI. The fourth digit indicates a patch release for Fomantic-UI-SASS.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

fomantic-ui-sass's People

Contributors

ahmed1490 avatar alecksjohannes avatar andreslemik avatar bananaappletw avatar chrise86 avatar confact avatar dijonkitchen avatar doabit avatar flipez avatar freakyfelt avatar hash4di avatar heyogrady avatar itmammoth avatar jameschevalier avatar jaredmoody avatar kjarrigan avatar ledermann avatar lin7sh avatar maartentibau avatar mroach avatar n-b avatar oskarsezerins avatar piya23300 avatar radfahrer avatar redrick avatar shanecav84 avatar sveredyuk avatar tauil avatar twoelevenjay avatar zohlgren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fomantic-ui-sass's Issues

The $import-google-fonts variable does not work anymore

I've tried to use the method provided in the README to disable loading of fonts from Google:

$import-google-fonts: false;
@import 'semantic-ui';

but the @import directive is still prepended to the CSS file. It seems that there was a test in the site.css file up to version v2.7.7 that is not present in subsequent versions:

@if $import-google-fonts {
  @import url($font-url);
}

I'd be glad to create a PR to fix this but I suspect you use some sort of automation to update sources from other projects. Please let me know if I can be of any help on this ๐Ÿ˜„

Error after upgrade from 2.8.4 to 2.8.5

Hi,
we use your gem at https://github.com/voxpupuli/vox-pupuli-tasks.
After updating your gem from 2.8.4 to 2.8.5 we get the following error while building the application:

bastelfreak@bastelfreak-ws ~/vox-pupuli-tasks $ SECRET_KEY_BASE=$(bundle exec rails secret) bundle exec rails assets:precompile
DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> Coffee::Rails::TemplateHandler.call(template)
To:
  >> Coffee::Rails::TemplateHandler.call(template, source)
 (called from <main> at /home/bastelfreak/vox-pupuli-tasks/Rakefile:8)
I, [2020-07-22T20:03:18.095213 #63546]  INFO -- sentry: ** [Raven] Raven 2.13.0 configured not to capture errors: DSN not set
DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> Coffee::Rails::TemplateHandler.call(template)
To:
  >> Coffee::Rails::TemplateHandler.call(template, source)
 (called from <main> at /home/bastelfreak/vox-pupuli-tasks/Rakefile:8)
I, [2020-07-22T20:03:19.418046 #63546]  INFO -- : Writing /home/bastelfreak/vox-pupuli-tasks/public/assets/application-eee7b95cec99d522f7655bd301f498b5e914b4cf5b3eef837c17d8bb3570a03b.js
I, [2020-07-22T20:03:19.418470 #63546]  INFO -- : Writing /home/bastelfreak/vox-pupuli-tasks/public/assets/application-eee7b95cec99d522f7655bd301f498b5e914b4cf5b3eef837c17d8bb3570a03b.js.gz
rails aborted!
Sass::SyntaxError: Invalid CSS after "i.icon.stopwatch.": expected class name, was "20:before"
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/fomantic-ui-sass-2.8.5/app/assets/stylesheets/semantic-ui/elements/_icon.scss:3041
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/fomantic-ui-sass-2.8.5/app/assets/stylesheets/semantic-ui/elements/_all.scss:7
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/fomantic-ui-sass-2.8.5/app/assets/stylesheets/semantic-ui.scss:2
/home/bastelfreak/vox-pupuli-tasks/app/assets/stylesheets/application.scss:17
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:1308:in `expected'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:1238:in `expected'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:1233:in `tok!'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:1097:in `ident!'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/static_parser.rb:194:in `class_selector'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/static_parser.rb:162:in `simple_selector_sequence'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/static_parser.rb:108:in `selector'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/static_parser.rb:83:in `selector_comma_sequence'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/parser.rb:1216:in `expr!'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/scss/static_parser.rb:20:in `parse_selector'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:434:in `visit_rule'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block (2 levels) in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `map'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `block in with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:322:in `visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block (2 levels) in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `map'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `block in with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:322:in `visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block (2 levels) in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `map'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:325:in `block in visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `block in with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:88:in `with_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:322:in `visit_import'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `block in with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:135:in `with_frame'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/stack.rb:79:in `with_base'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `map'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:157:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:10:in `visit'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/root_node.rb:36:in `css_tree'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/tree/root_node.rb:20:in `render'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-3.7.4/lib/sass/engine.rb:290:in `render'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sass-rails-5.1.0/lib/sass/rails/template.rb:47:in `evaluate'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/template.rb:109:in `render'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb:25:in `call'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:23:in `block in call'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/utils.rb:200:in `dfs'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/bundle.rb:24:in `call'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:60:in `block in load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:142:in `block in find'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `each'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:209:in `stat_directory'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:227:in `stat_tree'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `each'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `each'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:140:in `find'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/railties-6.0.3.2/lib/rails/command.rb:48:in `invoke'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/bastelfreak/vox-pupuli-tasks/vendor/ruby/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
bin/rails:6:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
bastelfreak@bastelfreak-ws ~/vox-pupuli-tasks $

this seems to be caused by the following change:

v2.8.4...v2.8.5#diff-726b9e44df36f7022d197285d1eec305R3041

if I understand this correctly, the file is vendored from Fomantic-UI. It seems to be fixed, but not yet released: fomantic/Fomantic-UI#1544

what's the right way for theming this?

i'm coming from bootstrap, i wonder what would be the correct way to do in in semanticui?
i expected to just load the variables, then load custom variables/overrides and load the rest of the css to compile it. however:

there are like no variables
https://github.com/fomantic/Fomantic-UI-SASS/blob/master/app/assets/stylesheets/semantic-ui/globals/_variables.scss

and colors etc are hardcoded
https://github.com/fomantic/Fomantic-UI-SASS/blob/master/app/assets/stylesheets/semantic-ui/elements/_loader.scss

the LESS file has it with variables: https://github.com/fomantic/Fomantic-UI/blob/master/src/definitions/elements/loader.less

if i read it correctly, this gem is a bit useless since it won't allow us customization as we should be able to do it?

how to apply overrides?

In my old semantic ui folder, there was a subfolder for overrides. I copied them all out to a single stylesheet and required them in the block like so:

`@import "semantic-ui";

/*
 *= require_self
 *= require fomantic_overrides
*/

but fomantic_overrides is not applying. how can i accomplish this theming?

Include JS in Rails 6

Any idea how to include the JavaScript in Rails 6 with Webpack? The //= require semantic-ui from the README no longer works, I think.

can we have npm version?

I love Fomantic-UI-SASS,
But it doesn't seem to have official support for npm users,
I would like to ask if there are plans to support npm?
Thank you

Checkbox unresponsive after errors

Rails adds a field_with_errors wrapper element around the invalid form element after submitting the form. This is used to style the form element with CSS (red border around an input field with invalid data for example).

The custom Fomantic UI checkbox (the iOS like toggle element) does not correctly handle this extra wrapper element making the field unresponsive: you can no longer check or uncheck the custom Fomantic UI checkbox.

As a workaround we can tell Rails not to add the wrapper element by adding config.action_view.field_error_proc = Proc.new { |html_tag, instance| html_tag.html_safe } to the config/application.rb file but this means we can no longer style form fields with errors.

Tested with fomantic-ui-sass 2.8.3 in a Rails 6.0.2 application.

`@supports` syntax not supported by LibSass

Problem

With the updates to Fomantic UI 2.9.0โ€“2.9.3, a SassC::SyntaxError is raised when building the Fomantic UI CSS:

SassC::SyntaxError in <controller action>

Showing <view path> where line #<line> raised:

Error: Invalid CSS after "@supports ": expected @supports condition (e.g. (display: flexbox)), was "selector(:has(.f)) "
        on line 541:10 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui/elements/_input.scss
        from line 9:1 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui/elements/_all.scss
        from line 2:1 of ../../../.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fomantic-ui-sass-2.9.3/app/assets/stylesheets/semantic-ui.scss
        from line 18:1 of app/assets/stylesheets/application.css.scss
>> @supports selector(:has(.f)) {
   ---------^

Official Sass fix

sass/sass#2780 deals with the extended @supports syntax, and references a fix for DartSass.

However, that issue explicitly says that LibSass will not be fixed because it is deprecated.

Potential solutions

  • Strip unsupported @supports syntax from the code, or
  • Change the gem dependencies from LibSass to DartSass.

Variables are defined for modules but not globals/site.scss - importing redundant code

When importing formantic.scss and using a variable to include a specific module you get additional CSS included which is not relevant to the use of that module.

By using, for example in a component scss to use a module you might have:

fomantic.scss

// The following path vars are for relative `url()` statements in the SCSS.
// They will be relative to the compiled entrypoint CSS file, which in our
// case is /fomantic.scss.
$theme-folder: '/src/assets/sass/fomantic-scss-custom/themes/default' !default;
$image-path: "#{$theme-folder}/assets/images" !default;
$font-path: "#{$theme-folder}/assets/fonts" !default;

// Generally, we import our custom theme first, then apply any unset variables
// from the default theme over them (variables in the default theme are defined
// with CSS `!default` so they are only used if they aren't already set.
//
// Sometimes, though, we want to use a variable from the default theme in our
// custom rules, in which case we need to either set it or pull in the file here
// before we can use them in our custom theme.
@import '../../../node_modules/fomantic-ui-sass/src/utils/all';
@import '../../../node_modules/fomantic-ui-sass/src/themes/default/globals/fonts/all';
@import '../../../node_modules/fomantic-ui-sass/src/themes/default/globals/colors/all';

// Then, we load up the whole shebang...
@import 'fomantic-custom-theme';                                 // custom theme variables
@import '../../../node_modules/fomantic-ui-sass/src/variables';     // default theme variables

And inside your component you might have:

@import "../assets/sass/fomantic.scss";
$primary: purple;
$use-accordion: true;
@import '../../node_modules/fomantic-ui-sass/src/semantic.scss';

...but this brings in additional CSS from src/definitions/globals/site.scss.

For a component I don't need the body style or a reset as this will have been brought in previously in the main app. So to avoid the unneeded css I might resort to importing the module directly. If you are importing the module directly then why would you need a variable to enable the css for it? Would it be a good idea to have the scss use variables for including/excluding the globals/site.scss styles so you can disable them specifically when using a module when importing the formantic.scss?

Something like this might work inside globals/site.scss:

/*******************************
             Page
*******************************/
@if not variable-exists(use-site-globals) or $use-site-globals==true {
  @if $import-google-fonts != false {
    @import url("#{$google-protocol}fonts.googleapis.com/css?family=#{$google-font-request}");
  }
  html,
  body {

.... etc ....

  textarea::selection,
  input::selection {
    background-color: $input-highlight-background;
    color: $input-highlight-color;
  }
}

and then in my component I can specifically disable that redundant CSS:

@import "../assets/sass/fomantic.scss";
$primary: purple;
$use-accordion: true;
$use-site-globals: false;
@import '../../node_modules/fomantic-ui-sass/src/semantic.scss';

I added this to my scss for globals/site.scss and also globals/reset.scss and it works well but this may conflict with a modules usage if it requires the other styles to be set. In which case, if a module requires css from reset.scss or site.scss it would make sense to import it into the module and separate it from the site/reset pages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.