🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vue3-container-directive

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-container-directive

Container query helper directive

0.0.1
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

vue3-container-directive

version download languages license vue@3.x

This directive is only adds styles to parent element.

  container-name: "some-name"; /* if passed by directive argument */
  container-type: inline-size;

then you can use @container queries as @media

  @container (max-width: 400px) {
    .card-child {
        /* some adaptive styling */
    }
}

More about @container queries

Install

npm

npm install vue3-container-directive
<template>
  <div id="app">
    <!-- directives for named container -->
    <div v-container:card>
      <div class="card-child"></div>
    </div>
    
    <!-- directives -->
    <div v-container>
      <div class="card-child"></div>
    </div>
    
  </div>
</template>

<style >
  .card-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  @container card (max-width: 400px) {
    /* rules for named container */
    .card-child {
      grid-template-columns: 1fr;
    }
  }

  @container (max-width: 400px) {
    .card-child {
      grid-template-columns: 1fr;
    }
  }
</style>

Keywords

container

FAQs

Package last updated on 11 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts