Developer Diary
  • Developer Diary
  • 2019

    • June 2019
    • July 2019
    • August 2019
    • September 2019
    • October 2019
    • November 2019
    • December, 2019
  • 2020

    • January 2020
    • February 2020
    • March 2020
    • April 2020
    • May, 2020
    • June 2020
    • July 2020
    • August 2020
    • September 2020
    • October 2020
    • November 2020
    • December 2020
  • 2021

    • January 2021
    • February 2021
    • February 2021
    • April 2021
    • May 2021
    • June 2021
    • July 2021
    • August 2021
    • September 2021
    • October 2021
    • November 2021
    • December 2021
  • 2022

    • January 2022
    • February 2022
    • March 2022
    • April 2022
    • May 2022
    • June 2022
    • July 2022
    • August 2022
    • September 2022
    • October 2022
    • November 2022
    • December 2022
  • 2023

    • January 2023
    • February 2023
    • March 2023
    • April 2023
    • May 2023
    • June 2023
    • July 2023
    • August 2023
    • September 2023
    • October 2023
    • November 2023
  • 2024

    • January 2024
    • February 2024
    • March 2024
    • April 2024
    • May 2024
    • June 2024
    • July 2024
    • August, 2024
    • September 2024
    • October 2024
    • November 2024
    • December 2024
  • 2025

    • January 2025
    • February 2025
    • March 2025
    • April 2025
    • May 2025
    • June 2025
    • July 2025
    • August 2025
    • September 2025
    • October 2025
    • November 2025

January 3, 2020

PGP Total Foodservice Landing

  • Unclear what the pop-up is supposed to do or what button you click to launch it.
  • I know the buy now buttons use an ajax modal showing another page, but that seems like a bad idea, asked AS for an example of a non-buy-now modal.
  • Modal is fancy-box though, so should be versatile.

Accessibility Task Force

  • Added items to digital process doc
  • looked at 3 more sections of Udemy training, took notes.

HLF Production unpublish

  • K got confused about the "hide page" function in Umbraco. Explained how to unpublish, directed her to E to re-index search.

Checking into a question about where PDFs come from on NST FMB site.

PGP Total Foodservice

  • just made a custom html block in Umbraco with display: none; then used fancybox 2.0's documentation to launch it. That way it's at least all on one page. Downside is TinyMCE won't show that content in the main display, so it looks empty.

Digging into Lupe authentication middleware

Looking at these links

  • https://codesandbox.io/s/github/nuxt/nuxt.js/tree/dev/examples/auth-jwt?from-embed
  • https://nuxtjs.org/examples/auth-external-jwt

But it looks like T already dealt with a lot of this. Tabling for now.

Lupe - config for branding and themes

  • Brands will have their own installations, so what's really needed is a config file that wouldn't be in the repo.
  • Working for components...

// https://nuxtjs.org/guide/plugins/#combined-inject

export default ({ app }, inject) => {
  inject('themeConfig', (themeConfig) => {
    return {
      brand: 'CSSI',
      loginLogo: 'https://i.ibb.co/3yhSYfG/cssi-logo-2x.png'
    }
  })
}
  plugins: [
    '~/plugins/themeConfig.js'
  ],
  computed: {
    loginLogo () {
      return this.$themeConfig().loginLogo
    }
  },

Need to see if it can work with styling in a way that makes sense.

First, need to combine stylesheets that are needed for component styling to make that process easier and DRYer.

@import '~assets/scss/dsm';
@import "~assets/scss/colors-aliases";
@import '~assets/scss/variables';
@import '~assets/scss/mixins';
@import '~assets/scss/vendor/index';

becomes

@import '~assets/scss/component-entry';

That works for now, but probably not for theme config.

Using a data attribute on things that are themed works...

.button--primary,
.button--tag {
  background-color: $clickable;
  @include font-btn-primary-center;
  &:hover {
    background-color: $clickable-hover;
  }
  &.button--small {
    @include font-btn-primary-small-center;
  }
  &[data-brand='CSSI'] {
    background-color: $cssi-clickable;
    &:hover {
      background-color: $cssi-clickable-hover;
    }
  }
}
  <button
    class="button button--primary"
    :data-brand="brand"
    @click="filtering = !filtering"
  >
    <span v-if="!filtering">Filter</span>
    <span v-else>Close</span>
  </button>

But I'm going to look into CSS custom properties instead.

Maybe we can define custom colors on a wrapper element?

Yes, we can define css custom properties on the default layout

<template>
  <div class="default-layout">
    <style>
      :root {
      --clickable: {{ colors.clickable }};
      }
    </style>
    <Navigation
      :toggled="toggled"
      @toggleNav="toggleNav"
    />
    <MobileMasthead
      :nav-state="toggled"
      @toggleNav="toggleNav"
    />
    <nuxt />
  </div>
</template>
  computed: {
    colors () {
      return this.$themeConfig().colors
    }
  },
.button--primary,
.button--tag {
  background-color: var(--clickable);
}

This makes the overrides sass file irrelevant. I think this means default colors are default, no changing them.

Works! Need to pause and think about what I actually want to be allowed to be defined.

Obviously, no IE support.
https://caniuse.com/#search=css custom properties

Custom property stuff

Should use fallbacks

.box{
  --box-color:#4d4e53;
  --box-padding: 0 10px;

  /* 10px is used because --box-margin is not defined. */
  margin: var(--box-margin, 10px);
}

Can check with Supports

$color: red;
:root {
  --color: red;
}

.box {
  @supports ( (--a: 0)) {
    color: var(--color);
  }
  @supports ( not (--a: 0)) {
    color: $color;
  }
}

https://www.smashingmagazine.com/2017/04/start-using-css-custom-properties/

Better fallbacks

fallback in root

    <style>
      :root {
      {{ colors.clickable ? '--clickable: ' + colors.clickable : '' }};
      {{ colors.clickableHover ? '--clickable-hover: ' + colors.clickableHover : '' }};
      }
    </style>

then in scss

.button--primary,
.button--tag {
  background-color: var(--clickable, $clickable);
  @include font-btn-primary-center;
  &:hover {
    background-color: var(--clickable-hover, $clickable-hover);
  }
  &.button--small {
    @include font-btn-primary-small-center;
  }
}