header {
  display: block;
  height: 10ex;
  border-bottom: 1px solid #f1f1f1;
  .logo {
  position: absolute;
  top: 1ex;
  left: 1em;
  font-size: 2em;
  color:royalblue;
} //.logo
  .search {
    display: block;
    width: auto;
    position: absolute;
    top: 1ex;
    right: 1em;
    a {
      display: inline-block;
      margin-right: 3em;
      padding: 2ex 2em;
      text-decoration: none;
      background-color: #4e1bb4;
      color: black;
    }
  } //.search
  .login-menu {
    .login {
      display: none;
      &.active {
        display: block;
      }
    } //.login
  } //.login-menu
} // header

header {
  display: block;
  height: 10ex;
  border-bottom: 1px solid #f1f1f1;
  .logo {
  position: absolute;
  top: 1ex;
  left: 1em;
  font-size: 2em;
  color:royalblue;
} //.logo
  .search {
    display: block;
    width: auto;
    position: absolute;
    top: 1ex;
    right: 1em;
    a {
      display: inline-block;
      margin-right: 3em;
      padding: 2ex 2em;
      text-decoration: none;
      background-color: #4e1bb4;
      color: black;
    }
  } //.search
  .login-menu {
    display: none;
    &.active {
      display: block;
    }
  } //.login-menu
} // header

Change selector to .login-menu for display active.
Change selector to .login-menu for display active.
