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

@greg-md/ng-flex-css-layout

v1.0.0-beta.10

Published

Flex-CSS-Layout is an alternative behaviour of Flex-Layout directives, that will still work with Angular Universal and App Shell.

Downloads

160

Readme

Angular Flex-CSS-Layout

npm version Build Status

Flex-CSS-Layout is an alternative behaviour of Flex-Layout directives, that will still work with Angular Universal and App Shell. It is not meant to replace Flex-Layout. You can freely use both modules on your needs.

The Flex-CSS-Layout engine intelligently generates internal style sheets(inside of <style> tags) rather than inline styles and leaves the CSS Media queries to be responsible of the layout.

Table of Contents:

Installation

To install this library, run:

$ npm install @greg-md/ng-flex-css-layout --save

How It Works

Please read Flex-Layout wiki first.

To take advantage of Flex-CSS-Layout features, you will have to change the prefix of Flex-Layout directives from fx to fc(which is FlexCss).

Flex-CSS-Layout currently supported directives(including Responsive API):

| Flex-Layout | Flex-CSS-Layout | | ------------- | ------------- | | fxLayout | fcLayout | | fxLayoutAlign | fcLayoutAlign | | fxLayoutGap | fcLayoutGap | | fxFlex | fcFlex | | fxFlexOrder | fcFlexOrder | | fxFlexOffset | fcFlexOffset | | fxFlexAlign | fcFlexAlign | | fxFlexFill | fcFlexFill | | fxShow | fcShow + fcDisplayDefault | | fxHide | fcHide + fcDisplayDefault |

Note: In some specific cases fc* directives may have different results than fx* directives. See Breakpoints Priorities.

A new attribute fcDisplayDefault was provided for fcShow and fcHide directives, that will apply when no display style could be found for the element. Useful for SSR.

Setting up in a module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

// 1. Import FlexCssModule;
import { FlexCssModule } from '@greg-md/ng-flex-css-layout';

import { AppComponent } from './app.component';

@NgModule({
  imports: [
    BrowserModule,
    // 2. Register FlexCssModule providers in root module;
    FlexCssModule.forRoot(),

    // 3. Import FlexCssModule directives to specific modules.
    FlexCssModule,
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule { }

Using in views

<div fcLayout="column">
  <div fcFlex="33">One</div>

  <div fcFlex="33%" [fcLayout]="direction">
    <div fcFlex="22%">Two One</div>
    <div fcFlex="205px">Two Two</div>
    <div fcFlex="30">Two Three</div>
  </div>

  <div fcFlex>Three</div>
</div>

Breakpoints Priorities

By default, breakpoints with smaller range and that applies on smaller screens have higher priority. See the next schema:

Breakpoints Priorities

How this looks in the code:

export const FLEX_CSS_DEFAULT_BREAKPOINTS: Breakpoint[] = [
  { alias: 'gt-xs', media: ['screen', '(min-width: 600px)'] },
  { alias: 'lt-xl', media: ['screen', '(max-width: 1919px)'] },
  { alias: 'gt-sm', media: ['screen', '(min-width: 960px)'] },
  { alias: 'lt-lg', media: ['screen', '(max-width: 1279px)'] },
  { alias: 'gt-md', media: ['screen', '(min-width: 1280px)'] },
  { alias: 'lt-md', media: ['screen', '(max-width: 959px)'] },
  { alias: 'gt-lg', media: ['screen', '(min-width: 1920px)'] },
  { alias: 'lt-sm', media: ['screen', '(max-width: 599px)'] },
  { alias: 'xl',    media: ['screen', '(min-width: 1920px)', '(max-width: 5000px)'] },
  { alias: 'lg',    media: ['screen', '(min-width: 1280px)', '(max-width: 1919px)'] },
  { alias: 'md',    media: ['screen', '(min-width: 960px)', '(max-width: 1279px)'] },
  { alias: 'sm',    media: ['screen', '(min-width: 600px)', '(max-width: 959px)'] },
  { alias: 'xs',    media: ['screen', '(max-width: 599px)'] },
];

If you want to reverse the priority, or change it as you want, you can redefine it in the module instantiation:

// Define new breakpoints directly.
FlexCssModule.forRoot([].concat(FLEX_CSS_DEFAULT_BREAKPOINTS).reverse());
// Or, provide a callable.
FlexCssModule.forRoot(breakpoints => [].concat(breakpoints).reverse());

License

MIT © Grigorii Duca

Huuuge Quote

I fear not the man who has practiced 10,000 programming languages once, but I fear the man who has practiced one programming language 10,000 times. #horrorsquad