npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-fui-less

v0.2.0

Published

Configure an ember-cli app to use fomantic-ui-less

Downloads

7

Readme

ember-fui-less

CI Ember Observer Score

Configure an ember-cli app to use fomantic-ui-less.

To use this addon, your project must also use ember-cli-less. If ember-cli-less is not already part of you app's devDependencies, it will be automatically added to your package.json.

This addon automatically adds the necessary paths to ember-cli-less's lessOptions to be able to @import the fomantic-ui-less source files from your app's less files.

This addon is not meant to provide ember components corresponding to the fomantic-ui modules!

Table of contents

Installation

ember install ember-fui-less

This will execte the following actions:

  1. Add ember-cli-less to your devDependencies
  2. Add fomantic-ui-less to your devDependencies
  3. Create the folder app/styles/fomantic
  4. Copy node_modules/fomantic-ui-less/theme.config to app/styles/fomantic/theme.config
  5. Copy part of node_modules/fomantic-ui-less/semantic.less to app/styles/fomantic/semantic.less (ommitting the Modules section)
  6. Create app/styles/app.less if necessary
  7. Insert @import 'app/styles/fomantic/semantic'; in app/styles/app.less

If your app was not already using configured to

Compatibility

  • Ember.js v3.13 or above
  • Ember CLI v2.13 or above
  • Node.js v12 or above

Usage

The app/styles/fomantic content is supposed to mimic the one found in node_modules/fomantic-ui-less.

Choosing what fomantic-ui definitions your app needs

⚠️ By default, every fomantic-ui Globals, Elements, Collections and Views will be @imported by in app/styles/fomantic/semantic.less. This will result in a slower build time for your app!⚠️

In app/styles/fomantic/semantic.less, Make sure you comment out every one of those imported files that your app does not use.


/* Elements */
& { @import "definitions/elements/button"; }    // My app uses fomantic-ui buttons
& { @import "definitions/elements/container"; } // My app uses fomantic-ui containers

// My app DOES NOT need these ⬇️ fomantic-ui elements
// & { @import "definitions/elements/divider"; }
// & { @import "definitions/elements/emoji"; }
// & { @import "definitions/elements/flag"; }
// & { @import "definitions/elements/header"; }
// & { @import "definitions/elements/icon"; }
// & { @import "definitions/elements/image"; }
// & { @import "definitions/elements/input"; }
// & { @import "definitions/elements/label"; }
// & { @import "definitions/elements/list"; }
// & { @import "definitions/elements/loader"; }
// & { @import "definitions/elements/placeholder"; }
// & { @import "definitions/elements/rail"; }
// & { @import "definitions/elements/reveal"; }
// & { @import "definitions/elements/segment"; }
// & { @import "definitions/elements/step"; }
// & { @import "definitions/elements/text"; }

Theming

You can easily use the theming system of fomantic-ui with ember-fui-less.

This addon provides the fui-theming blueprint to generate the files necessary to customize the site theme.

theming files: .variables

For example, you could start building the site theme of your application with:

ember generate fui-theming --type="global" --element="site"

This would create the file app/styles/fomantic/site/globas/site.variables. This file is by default empty (if you except the comments). You could then modify the primary color:

@primaryColor: red;

and check the result by adding a primary button in one of your templates:

<button class="ui primary button" type="button">
  A Primary Button
</button>

Fomantic-ui has MANY variables available to configure your theme, and that can be quite overwhelming. The best way to grasp the power of theming is to read through the default theme variables file, for example themes/default/globals/site.variables

theming files: .overrides

You can also generate the <element>.overrides theming file if you need more CSS rules for the selectors defined by fomantic-ui.

For example, here is the default fomantic-ui definition for the .ui.active.button selector:

.ui.active.button {
  background-color: @activeBackgroundColor;
  background-image: @activeBackgroundImage;
  box-shadow: @activeBoxShadow;
  color: @activeColor;
}

Let's say you need your active buttons to have a 3px solid border. Here is what you would need to do:

ember generate fui-theming --type="element" --element="button" --extension="overrides"

This would create the file app/styles/fomantic/site/elements/button.overrides. Now, you just need to enter this new .ui.active.button selector definition:

.ui.active.button {
  background-color: @activeBackgroundColor;
  background-image: @activeBackgroundImage;
  box-shadow: @activeBoxShadow;
  color: @activeColor;
  border: 3px solid;
}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Credits

Yarn workspace test-packages setup idea inspired from ember-css-modules