Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Strange, differing behaviour on view all #372

@svenHoskens

Description

@svenHoskens

These issues might be unrelated. I've encountered them both in my own project, using starterkit-twig-base, and a demo project I just installed to make sure using starterkit-twig-demo.

I installed patternlab with composer create-project pattern-lab/edition-twig-standard example && cd $_ and run it using the generate command, followed by the server command.

The initial page load on localhost:8080 looks good. The of the shadow dom object looks like this:

<head>
    <title>Pattern Lab</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="../../css/style.css?1472586900" media="all">
    <link rel="stylesheet" href="../../css/pattern-scaffolding.css?1472586900" media="all">

    <!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->
    <!-- never cache patterns -->
<meta http-equiv="cache-control" content="max-age=0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
<meta http-equiv="pragma" content="no-cache">

<link rel="stylesheet" href="../../styleguide/css/styleguide.min.css?1472586900" media="all">
<link rel="stylesheet" href="../../styleguide/css/prism-typeahead.min.css?1472586900" media="all">
    <!-- End Pattern Lab -->
</head>

However, once I use the navbar and click atoms > view all, the layout fails. The shadow dom's head has changed to this:

<head>
    <title>Pattern Lab</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="../../css/style.css?1472586900" media="all">
    <link rel="stylesheet" href="../../css/pattern-scaffolding.css?1472586900" media="all">

    <!-- Begin Pattern Lab (Required for Pattern Lab to run properly) -->

    <!-- End Pattern Lab -->

  </head>

As you can see, all meta tags and stylesheets between the tags are not injected properly. From this point onward, styling for patternlab itself isn't correct and the navigation has stopped working.

Perhaps my second issue is related. If I click molecules > view all, the top navigation bar becomes duplicated. Inspecting the page reveals that the shadow dom object is a copy of the outer object. (For example, the of the inner object also has id="patternlab-head")

If I click on organisms > view all, I'm redirected to http://localhost:8080/?p=viewall-molecules-messaging. templates > view all also redirects to the wrong page, namely organisms-sections. The general, right most 'all' link seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions