Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gyldendal/kobber-scene

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gyldendal/kobber-scene

Components for rendering scene objects from Gyldendal's CMS.

  • 0.3.30
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
128
decreased by-12.93%
Maintainers
0
Weekly downloads
 
Created
Source

Kobber scene

Components for rendering scene objects from Gyldendal's CMS.

See Scene.stories.tsx for examples.

Can be imported as web components or react components:

@gyldendal/kobber-scene/web-components
@gyldendal/kobber-scene/react

CMS data

Enums that match data from CMS are defined in types.ts

Calculate padding

Pass CMS-data and other variables through the calculatePadding-function and pass it to kobber-scene-boundary to apply css paddings.

import { calculatePadding } from '@gyldendal/kobber-scene/web-components';

const padding = calculatePadding({
  cmsWhiteSpace: sceneFromCms.sceneWhitespace,
  cmsHorizontalAlignment: sceneFromCms.sceneHorizontalAlignments
});
<kobber-scene>
  <kobber-scene-boundary padding=${JSON.stringify(padding)}>
    ...
  </kobber-scene-boundary>
</kobber-scene>

Optional presentation logic

The following rules are applied to thousands of scenes in Skolestudio:

  • The sections sc-feature-header and sc-card-carousel are displayed in full width
  • sc-feature-header affects the wrapping row's bottom padding
  • Dynamic contents are displayed in full width and full height if there is no other content in the scene
  • Dynamic contents are displayed in full width if there is no other content in the row

To apply the same rules, pass scene.rows through groupRowsByPresentation and render each rowGroup as in Skolestudio.

FAQs

Package last updated on 13 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc