// .linked >        element            child
$_linked_widgets: ("%button",          ""),
                  ("button",           ""),
                  ("menubutton",       "> button"),
                  ("dropdown",         "> button"),
                  ("colorbutton",      "> button"),
                  ("fontbutton",       "> button"),
                  ("combobox",         "> box > button.combo"),
                  ("appchooserbutton", "> combobox > box > button.combo"),
                  ("%entry",           ""),
                  ("entry",            "");

@each $widget, $child in $_linked_widgets {
  .linked:not(.vertical) > {
    #{$widget} {
      &:dir(ltr):not(:first-child) #{$child},
      &:dir(rtl):not(:last-child) #{$child} {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        margin-left: -1px;
      }

      &:dir(ltr):not(:last-child) #{$child},
      &:dir(rtl):not(:first-child) #{$child} {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
      }
    }
  }

  .linked.vertical {
    #{$widget} {
      &:not(:first-child) #{$child} {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        margin-top: -1px;
      }

      &:not(:last-child) #{$child} {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
      }
    }
  }
}
