diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 4e5e5f744..ce7b9d82a 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -87,12 +87,6 @@ class PagesController < ApplicationController ) end - def crayons - @page = Page.find_by(slug: "crayons") - render :show if @page - set_surrogate_key_header "crayons_page" - end - private def latest_published_thread(tag_name) diff --git a/app/javascript/.storybook/storybook.scss b/app/javascript/.storybook/storybook.scss index c05e6b21b..cf09f8e00 100644 --- a/app/javascript/.storybook/storybook.scss +++ b/app/javascript/.storybook/storybook.scss @@ -7,6 +7,7 @@ body { display: grid; grid-template-rows: 1fr; grid-template-columns: 1fr; + padding: 2rem; justify-items: center; align-items: center; height: 100vh; diff --git a/app/javascript/designSystem/__stories__/avatarsAndLogos.stories.jsx b/app/javascript/designSystem/__stories__/avatarsAndLogos.stories.jsx new file mode 100644 index 000000000..a662dd3d0 --- /dev/null +++ b/app/javascript/designSystem/__stories__/avatarsAndLogos.stories.jsx @@ -0,0 +1,107 @@ +import { h } from 'preact'; +import { storiesOf } from '@storybook/react'; + +import './designSystem.scss'; + +storiesOf('Base/Components/HTML/Avatars & Logos', module).add( + 'Description', + () => ( +
An image representing a user is called an avatar.
+An image representing a company or organization is called a logo.
++ To make a distinction between these two different entities we should + keep them visually different. For Avatars, we gonna use circle shape. + And for Logos we gonna use square shape. This will help recognize what + is what in a heartbeat. +
++ Each of these will be available in 5 different sizes (use your best + judgment in picking right size): +
+Remember to use descriptive alt="" values!
+
+
+ ))
+ .add('Large', () => (
+
+
+
+ ))
+ .add('Extra Large', () => (
+
+
+
+ ))
+ .add('2XL', () => (
+
+
+
+ ))
+ .add('3XL', () => (
+
+
+
+ ));
+
+storiesOf('Base/Components/HTML/Avatars & Logos/Logos')
+ .add('Default (Small)', () => (
+
+ + “Box” will be a background element used for many other components, for + example banners, dropdowns, modals. This component does not have any + guidelines in terms of placement or spacing, since it’s supposed to be + used to build other components. +
+There are:
++ By default use “outlined” type unless you really have to make something + stand out - then use “filled”. But double check if it makes sense since + “filled” style really steals attention. +
++ Use style that makes the most sense for you current use case. It’s + pretty obvious when to use Danger, Warning and Success. But for Default + and Info - it’s more up to designer to make a good call :). +
+Elevations should define what kind of element it is:
++ Use Danger style only for destructive actions like removing something. + Do not use it for, for example “unfollow” action. +
++ If you have to use several buttons together, keep in mind you should + always have ONE Primary button. Rest of them should be Secondary and/or + Outlined and/or Text buttons. +
++ It is ok to use ONLY Secondary or outlined button without being + accompanied by Primary one. +
++ For Stacking buttons (vertically or horizontally) please use 8px spacing + unit for default size buttons (no matter if stacking horizontally or + vertically). +
++ Dropdowns should have position relative to it’s trigger. They can be + used for some 2nd level navigations, contextual configurations, etc... +
+Dropdowns should not be bigger than 320px.
+Dropdown default padding should be dependent on width:
+
+ If you need to utilize entire dropdown area and you have to get rid of
+ default padding, please use modifier class
+ crayons-dropdown--padding-0
+ .
+
+ FYI: Dropdowns use “Box” component as background, with Level 3 + elevation. +
++ Because of accessibility most (ideally all) fields should have label + above. +
++ Fields can also have optional description - between Label and Field + itself. +
++ Fields can also have additional optional description, for example + characters count. +
++ Labels for checkboxes and radios should be placed next to the form + element. +
+Using additional description is optional.
++ It is possible to group checkboxes or radios into logical sections. + Section may require having it’s own label (title). +
++ Another description just in case... +
++ Indicators are meant to be used to inform user about, for example, + unread notifications. They supposed to steal user's attention and + make him notice or click specific element. +
++ We should keep in mind to never show too many indicators at the same + time. Use your best judgment. +
+There're two types of indicators:
+And there're four styles to pick from:
+Used as main nav in left sidebar or dropdowns...
+Can contain icons.
++ Modals should be positioned centered in relation to entire viewport. So + relation to its tirgger doesn’t really matter. +
+There are 3 sizes of modals:
+Use your best judgements when choosing the right size.
+
+ If you need to utilize entire modal area and you have to get rid of
+ default padding, please use modifier class
+ crayons-modal--padding-0
+ .
+
+ FYI: Modals use “Box” component as background, with Level 3 elevation. +
+Use tabs as 2nd level navigation or filtering options.
++ Use Notices to focus user on specific piece of content, for example (but + not limited to): +
++ This should be simple message. And this is exactly what this Figma + component let you do. +
+By default, this component has 16px padding.
++ Default font is set to 16px (fs-base). It should be standard in UI. + Smaller and bigger font sizes should be used carefully with respect to + good visual rythm between elements. +
++ XS size should be used as little as possible in edge cases. Even though + it’s readable we could consider it not meeting DEV’s standards. So keep + it for like “asterisk copy” etc. +
+By default you should be using Regular font weight.
++ Medium should be used to emphasize something but not make it as loud as + Bold. +
+Heavy should be used only for bigger title.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
++ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore iusto, + molestias. Ex asperiores modi libero id laudantium ipsum perspiciatis, + architecto enim suscipit delectus odit, explicabo quas, voluptatum + quibusdam, distinctio ut. +
++ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore iusto, + molestias. Ex asperiores modi libero id laudantium ipsum perspiciatis, + architecto enim suscipit delectus odit, explicabo quas, voluptatum + quibusdam, distinctio ut. +
++ Its main purpose is to add a bit of flavor to DEV brand but it should + never be the main font. +
+Please, do not overuse Accent typography.
++ We strongly encourage to limit number of sizes and weights to what + presetned below. +
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet.
+Default font is set to 16px (fs-base). It should be standard in UI. Smaller and bigger font sizes should be used carefully with respect to good visual rythm between elements.
-XS size should be used as little as possible in edge cases. Even though it’s readable we could consider it not meeting DEV’s standards. So keep it for like “asterisk copy” etc.
-By default you should be using Regular font weight.
-Medium should be used to emphasize something but not make it as loud as Bold.
-Heavy should be used only for bigger title.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore iusto, molestias. Ex asperiores modi libero id laudantium ipsum perspiciatis, architecto enim suscipit delectus odit, explicabo quas, voluptatum quibusdam, distinctio ut.
-Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore iusto, molestias. Ex asperiores modi libero id laudantium ipsum perspiciatis, architecto enim suscipit delectus odit, explicabo quas, voluptatum quibusdam, distinctio ut.
-<%=' - -- -...
-...
-...
-...
-...
-...
-...
-...
-...
- - -...
-...
-...
-...
- - - - - '.rstrip %>
Its main purpose is to add a bit of flavor to DEV brand but it should never be the main font.
-Please, do not overuse Accent typography.
-We strongly encourage to limit number of sizes and weights to what presetned below.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-Lorem ipsum dolor sit amet.
-<%=' - --...
-...
-...
-...
- - -...
-...
- - - - - '.rstrip %>
<%=' - - - '.rstrip %>- -
<%=' - - - '.rstrip %>- -
<%=' - - - - - '.rstrip %>- -
<%=' - - - - - '.rstrip %>-
Because of accessibility most (ideally all) fields should have label above.
-Fields can also have optional description - between Label and Field itself.
-Fields can also have additional optional description, for example characters count.
-Another description just in case...
-<%=' -- -- - -- '.rstrip %>Another description just in case...
-
Labels for checkboxes and radios should be placed next to the form element.
-Using additional description is optional.
-It is possible to group checkboxes or radios into logical sections. Section may require having it’s own label (title).
-<%=' -- -- - -- '.rstrip %>
<%=' -- --- '.rstrip %>- - -- -- ... -- - ... -
<%=' -- - --- '.rstrip %>- - -- -- ... -- - ... -
<%=' -- -- - -- '.rstrip %>
<%=' -- --- '.rstrip %>- - -- -- ... -- - ... -
<%=' ---- '.rstrip %>- - -- -- ... -- - ... -
Use Danger style only for destructive actions like removing something. Do not use it for, for example “unfollow” action.
-If you have to use several buttons together, keep in mind you should always have ONE Primary button. Rest of them should be Secondary and/or Outlined and/or Text buttons.
-It is ok to use ONLY Secondary or outlined button without being accompanied by Primary one.
-For Stacking buttons (vertically or horizontally) please use 8px spacing unit for default size buttons (no matter if stacking horizontally or vertically).
-<%=' - Button label - Full Button label - Secondary Button label - Outlined Button label - Text Button label - Danger Button label - Button - Button - '.rstrip %>-
“Box” will be a background element used for many other components, for example banners, dropdowns, modals. This component does not have any guidelines in terms of placement or spacing, since it’s supposed to be used to build other components.
-There are:
-By default use “outlined” type unless you really have to make something stand out - then use “filled”. But double check if it makes sense since “filled” style really steals attention.
-Use style that makes the most sense for you current use case. It’s pretty obvious when to use Danger, Warning and Success. But for Default and Info - it’s more up to designer to make a good call :).
-Elevations should define what kind of element it is:
-<%=' - -box, level 0- - <-- levels 0-3 --> -box, level 1-box, level 2-box, level 3- - <-- filled variation --> -filled box, level 0- - <-- styles: danger, success, warning, info --> ----- '.rstrip %> -- --- --- -Dropdowns
-Dropdowns should have position relative to it’s trigger. They can be used for some 2nd level navigations, contextual configurations, etc...
-Dropdowns should not be bigger than 320px.
-Dropdown default padding should be dependent on width:
--
-- <250px: 16px
-- 251 - 320px: 24px
-If you need to utilize entire dropdown area and you have to get rid of default padding, please use modifier class
-crayons-dropdown--padding-0.FYI: Dropdowns use “Box” component as background, with Level 3 elevation.
--- -- Hey, I'm a dropdown content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. ---- -- Hey, I'm a dropdown content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. ---- -- Hey, I'm a dropdown content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. --<%=' --- Hey, ... -- -- Hey, ... -- -- Hey, ... -- '.rstrip %>-- --- -Modals
-Modals should be positioned centered in relation to entire viewport. So relation to its tirgger doesn’t really matter.
-
There are 3 sizes of modals:
--
-- S(mall): 480px width with 24px padding
-- Default: 640px width with 32px padding
-- L(arge): 800px width with 48px padding
-Use your best judgements when choosing the right size.
-If you need to utilize entire modal area and you have to get rid of default padding, please use modifier class
-crayons-modal--padding-0.FYI: Modals use “Box” component as background, with Level 3 elevation.
--- -- Hey, I'm a Default Modal content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. ---- -- Hey, I'm a Small Modal content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. ---- -- Hey, I'm a Large Modal content! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. ---- -- Hey, I'm a modal content with no padding! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi ea voluptates quaerat eos consequuntur temporibus. --<%=' --- Hey, ... -- -- Hey, ... -- -- Hey, ... -- -- Hey, ... -- '.rstrip %>-- --- -Notices
-Use Notices to focus user on specific piece of content, for example (but not limited to):
--
-- alerts after form submission,
-- box with tip like “Did you know..?”
-- etc...
-This should be simple message. And this is exactly what this Figma component let you do.
-By default, this component has 16px padding.
--- -This is Default Notice content.
-This is Default Notice content.
-This is Warning Notice content.
-This is Success Notice content.
-This is Info Notice content.-<%=' - --This...- - -This...-This...-This...-This...- '.rstrip %>-- ---Indicators
-Indicators are meant to be used to inform user about, for example, unread notifications. They supposed to steal user's attention and make him notice or click specific element.
-We should keep in mind to never show too many indicators at the same time. Use your best judgment.
-There're two types of indicators:
--
-- Rectangle with label (text or number)
-- Bullet - just a circle without any text on it.
-And there're four styles to pick from:
--
-- Default (grey) - nothing really crucial, basic information about something.
-- Accent (blueish) - something we want user to be aware of but it's also not crucial information
-- Critical (red) - something super important, don't overuse it!!
-- Inverted (dark grey) - alternative to the default one, especially when we need to show two defautl indicators next to each other.
-- Label - Outlined - 1 - -- -- Label - Outlined - 1 - -- -- Label - Outlined - 1 - -- -- Label - Outlined - 1 - -- -<%=' - Label - 1 - - - - ... - ... - ... - '.rstrip %>--- - - - \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 397753634..e453467ab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -282,7 +282,6 @@ Rails.application.routes.draw do # You can have the root of your site routed with "root get "/about" => "pages#about" - get "/page/crayons" => "pages#crayons" get "/robots.:format" => "pages#robots" get "/api", to: redirect("https://docs.dev.to/api") get "/privacy" => "pages#privacy"--Avatars & Logos
-An image representing a user is called an avatar.
-An image representing a company or organization is called a logo.
-To make a distinction between these two different entities we should keep them visually different. For Avatars, we gonna use circle shape. And for Logos we gonna use square shape. This will help recognize what is what in a heartbeat.
-Each of these will be available in 5 different sizes (use your best judgment in picking right size):
--
-- Default: 24px
-- L(arge): 32px
-- XL(arge): 48px
-- 2XL(arge): 64px
-- 3XL(arge): 128px
-Remember to use descriptive alt="" values!
--- -" class="crayons-avatar__image" alt="Ben" /> -
" class="crayons-avatar__image" alt="Ben" /> -
" class="crayons-avatar__image" alt="Ben" /> -
" class="crayons-avatar__image" alt="Ben" /> -
" class="crayons-avatar__image" alt="Ben" /> -
<%=' -- -- - - ... - ... - ... - ... - '.rstrip %>
-- -" class="crayons-logo__image" alt="Acme Inc." /> -
" class="crayons-logo__image" alt="Acme Inc." /> -
" class="crayons-logo__image" alt="Acme Inc." /> -
" class="crayons-logo__image" alt="Acme Inc." /> -
" class="crayons-logo__image" alt="Acme Inc." /> -
<%=' --- - - ... - ... - ... - ... - '.rstrip %>