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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@filip.mazev/blocks-core

v0.0.6

Published

**Blocks Core** is the foundational library for the Blocks ecosystem. It provides the essential infrastructure for building responsive, theme-aware Angular applications. It bridges the gap between TypeScript logic and SCSS styling, offering a unified syst

Downloads

468

Readme

@filip.mazev/blocks-core

Blocks - Core Library

Blocks Core is the foundational library for the Blocks ecosystem. It provides the essential infrastructure for building responsive, theme-aware Angular applications. It bridges the gap between TypeScript logic and SCSS styling, offering a unified system for breakpoints, device detection, scroll management and theming.

Styles & Theming

Blocks Core utilizes a robust SCSS architecture to manage design tokens and responsiveness.

1. Theme Provider

The library uses a CSS Variable system generated via SCSS maps. To initialize the core theme, use the core-theme mixin in your global styles.

@use '@filip.mazev/blocks-core/src/lib/styles/index' as blocks;

:root {
  // Initialize default light theme
  @include blocks.core-theme(blocks.$default-light-theme-config);
}

// Example: Switch to dark theme based on a class
body.dark-theme {
  @include blocks.core-theme(blocks.$default-dark-theme-config);
}

This generates CSS variables with the --fm- prefix (e.g.,--fm-primary, --fm-bg-surface, --fm-text-main).

2. Responsive Mixins

The library provides mixins that strictly align with the WindowDimensionsService breakpoints in TypeScript.

Available Breakpoints:

  • xs: 360px
  • sm: 640px
  • md: 768px
  • lg: 1024px
  • xl: 1280px
  • 2xl: 1536px
  • 3xl: 1920px
  • 4xl: 2560px

Usage:

@use '@filip.mazev/blocks-core/src/lib/styles/mixins' as *;

.my-element {
  width: 100%;

  // Applies when width >= 768px
  @include respond-up(md) {
    width: 50%;
  }

  // Applies when width <= 640px
  @include respond-down(sm) {
    display: none;
  }
}

Core Services

WindowDimensionsService

Bridges the gap between CSS media queries and TypeScript logic. It provides reactive access to window size and standard breakpoint thresholds.

export class MyComponent {
  protected windowDimensionsService = inject(WindowDimensionsService);
  
  protected windowDimensions = this.windowDimensionsService.dimensions;
  protected breakpoints = this.windowDimensionsService.breakpoints;

  constructor() {
    effect(() => {
      const width = this.windowDimensions().width;
      const isOnSmallScreen = width < this.breakpoints.sm;
      // handle logic for small screen for example
    });
  }
}

ThemingService

Handles the detection of system preferences (Dark/Light mode) and manages the application-level theme state.

  • getSystemTheme$(): Observes the OS/Browser prefers-color-scheme.
  • getApplicationTheme$(): Observes the manually set application theme.
  • setApplicationTheme(theme: DeviceTheme): Manually overrides the current theme ('light' | 'dark').

DeviceTypeService

Provides detailed information about the user's device, OS, and orientation. Useful for logic that depends on specific hardware capabilities (e.g., touch handling on Windows tablets vs Android).

getDeviceState() returns:

  • isMobile / isTablet / isDesktop
  • desktopOS (Windows, Mac, Linux, Unix)
  • mobileOS (iOS, Android)
  • isAppleDevice (checks both iOS and MacOS)
  • isLandscapeOrientation / isPortraitOrientation

ScrollLockService

A utility to prevent background scrolling when overlays (like Modals) are active. This service handles complex edge cases, including:

  • Scrollbar Compensation: Adds padding to the body to prevent layout shifts when the scrollbar disappears.

  • Mobile Touch: Prevents "scroll chaining" on mobile devices.

  • Extreme Overflow: Optionally disables wheel and touch events entirely for strict locking.

// Lock scroll
this.scrollLockService.disableScroll({
  handleTouchInput: true,
  handleExtremeOverflow: false
});

// Unlock
this.scrollLockService.enableScroll();

Installation

To use Blocks Core, install the package and ensure the SCSS partials are accessible to your build pipeline.

(Installation instructions depend on your specific build/publish setup).