Skip to content

Commit

Permalink
Merge pull request #186 from ably/linear-design-system-updates
Browse files Browse the repository at this point in the history
Linear design system updates
  • Loading branch information
Dominik authored Aug 4, 2022
2 parents 5b20867 + c8cb222 commit 9544d2a
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 28 deletions.
5 changes: 3 additions & 2 deletions preview/app/components/colours_list_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ def colours
{ bg: 'bg-gui-error', name: "Error", hex: '#fb0c0c' },
{ bg: 'bg-gui-default', name: "Default", hex: '#0073e6' },
{ bg: 'bg-gui-hover', name: "Hover", hex: '#0867c4' },
{ bg: 'bg-gui-focus', name: "Focus", hex: '#80b9f2' },
{ bg: 'bg-gui-focus', name: "Focus", hex: '#0073e6' },
{ bg: 'bg-gui-focus-outline', name: "Focus Outline", hex: '#80b9f2' },
{ bg: 'bg-gui-active', name: "Active", hex: '#074095' },
{ bg: 'bg-gui-viewed', name: "Viewed", hex: '#4887c2' },
{ bg: 'bg-gui-visited', name: "Visited", hex: '#4887c2' },
{ bg: 'bg-gui-unavailable', name: "Unavailable", hex: '#a8a8a8' }
]
}
Expand Down
4 changes: 4 additions & 0 deletions preview/app/views/pages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@
<div class="p-16 mb-16 mr-16 border rounded bg-cool-black">
<p class="font-sans ui-text-p1 text-white">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, <a href="/123" class="ui-link">per inceptos himenaeos</a>.</p>
</div>

<div class="p-16 mb-16 mr-16 border rounded bg-jazzy-pink">
<p class="font-sans ui-text-p1 text-charcoal-grey">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, <a href="/123" class="ui-link-neutral">per inceptos himenaeos</a>.</p>
</div>
</div>
</div>

Expand Down
4 changes: 1 addition & 3 deletions src/core/Code/component.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@layer base {
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&display=swap");
}
@import "../fonts/source-code-pro.css";

@layer components {
.hljs {
Expand Down
3 changes: 3 additions & 0 deletions src/core/fonts/source-code-pro.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@layer base {
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@600&display=swap");
}
7 changes: 4 additions & 3 deletions src/core/styles/properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
--color-charcoal-grey: #292831;
--color-gui-default: #0073e6;
--color-gui-hover: #0867c4;
--color-gui-focus: #80b9f2;
--color-gui-focus: #0073e6;
--color-gui-focus-outline: #80b9f2;
--color-gui-active: #074095;
--color-gui-viewed: #4887c2;
--color-gui-visited: #4887c2;
--color-gui-unavailable: #a8a8a8;
--color-gui-error: #fb0c0c;
--color-gui-success: #11cb24;
Expand Down Expand Up @@ -155,7 +156,7 @@
/* In components, when looking at implementing viewport margin and spacing between elements,
the values in the comments can be used as guide as they represent the grid the elements (should) sit on.
alternatively, look for ui-grid-* helpers. */
--bp-xs: 375px; /* gutters 8px, side-margin 24px */
--bp-xs: 428px; /* gutters 8px, side-margin 24px */
--bp-sm: 768px; /* gutters 16px, side-margin 32px */
--bp-md: 1040px; /* gutters 24px, side-margin 40px, meganav desktop */
--bp-lg: 1280px; /* gutters 24px, side-margin 64px */
Expand Down
28 changes: 12 additions & 16 deletions src/core/styles/text.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
}

.ui-text-p1 {
@apply font-sans font-light text-cool-black;
@apply font-sans font-light text-charcoal-grey;
@apply text-p1;
}

.ui-text-p2 {
@apply font-sans font-light text-cool-black;
@apply font-sans font-light text-charcoal-grey;
@apply text-p2;
}

.ui-text-p3 {
@apply font-sans font-light text-cool-black;
@apply font-sans font-light text-charcoal-grey;
@apply text-p3;
}

Expand Down Expand Up @@ -146,21 +146,17 @@
@apply list-square;
}

/* visited needs to come before :hover et all else it overrides them */
.ui-link:visited {
@apply text-gui-viewed;
}

.ui-link {
@apply hover:text-active-orange active:text-red-orange;
text-decoration-color: var(--color-active-orange);
text-underline-offset: 4px; /* px used here as behaves weird with rem's */
text-decoration-line: underline;
text-decoration-thickness: 0.125rem;
@apply visited:text-gui-visited;
@apply hover:text-gui-hover active:text-gui-active disabled:text-gui-unavailable;
@apply focus:text-gui-focus focus:outline-gui-focus;
@apply underline;
}

.ui-link:focus {
@apply focus:text-white focus:bg-active-orange focus:outline-none;
text-decoration: none;
.ui-link-neutral {
@apply visited:text-dark-grey;
@apply hover:text-dark-grey active:text-cool-black disabled:text-gui-unavailable;
@apply focus:text-gui-focus focus:outline-gui-focus-neutral;
@apply underline;
}
}
16 changes: 12 additions & 4 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
theme: {
screens: {
// CSS custom properties can't be used in media queries
xs: "375px",
xs: "428px",
sm: "768px",
md: "1040px",
lg: "1280px",
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = {
"gui-hover": "var(--color-gui-hover)",
"gui-focus": "var(--color-gui-focus)",
"gui-active": "var(--color-gui-active)",
"gui-viewed": "var(--color-gui-viewed)",
"gui-visited": "var(--color-gui-visited)",
"gui-unavailable": "var(--color-gui-unavailable)",
"gui-error": "var(--color-gui-error)",
"gui-success": "var(--color-gui-success)",
Expand Down Expand Up @@ -181,7 +181,8 @@ module.exports = {
filter: "filter",
},
outline: {
"gui-focus": "4px solid var(--color-gui-focus)",
"gui-focus": "1.5px solid var(--color-gui-focus-outline)",
"gui-focus-neutral": "2px solid var(--color-white)",
},
width: {
"extend-8": "calc(100% + var(--spacing-8))",
Expand All @@ -208,7 +209,14 @@ module.exports = {
variants: {
extend: {
borderColor: ["hover", "focus", "active", "group-focus", "disabled"],
textColor: ["hover", "focus", "active", "group-focus", "disabled"],
textColor: [
"hover",
"focus",
"active",
"group-focus",
"disabled",
"visited",
],
display: ["group-focus"],
backgroundColor: ["hover", "focus", "active", "group-focus", "disabled"],
backgroundImage: ["hover", "active", "focus"],
Expand Down

0 comments on commit 9544d2a

Please sign in to comment.