New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gyldendal/kobber-scene

Package Overview
Dependencies
Maintainers
0
Versions
80
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.78
Source
npm
Version published
Weekly downloads
361
193.5%
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 25 Feb 2025

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