Skip to content

Commit c7be2e4

Browse files
committed
adds CSS styleguide to contributing documentation
1 parent 2c125d9 commit c7be2e4

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ today! Here are the guidelines we'd like you to follow:
66
- [Contributing Code](#contribute-code)
77
- [Commit Message Guidelines](#commit)
88
- [Contributing Documentation](#documentation)
9+
- [CSS Styleguide](contributing/css-styleguide.md)
910

1011
### <a name="issue"></a> Found an Issue?
1112
If you find a bug in the source code or a mistake in the documentation, you can help us by

contributing/css-styleguide.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CSS Style Guide for Arches 7.x
2+
## Definitions
3+
4+
### RTL Styling
5+
RTL (Right to Left) interfaces for internationalization are supported in Arches 7.x.
6+
Some languages used in Arches (Hebrew, Arabic) have different UI needs because they
7+
are read from right to left. The guidelines in this document will help conform to
8+
generally accepted RTL interface design principles.
9+
10+
### Responsive Design
11+
Responsive design means that the interface of Arches should respond to changes in
12+
size (specifically width). This helps to accommodate differing screen sizes
13+
(including very small screens, like mobile devices).
14+
15+
## Guidelines
16+
### General advice:
17+
- Use scss to group related styles together through nesting.
18+
- Use rtl.scss as a last resort to overriding styles in arches.scss for RTL.
19+
- Test styles by using the “dir” attribute of the body HTML tag of the page being
20+
worked on. Change it to “rtl” and the page will mirror as an RTL user would see
21+
the page. (Note that it’s necessary to actually change the page language in the
22+
Arches language dropdown in order to have rtl.scss included)
23+
- To get an idea about how RTL interfaces are different from LTR interfaces (and
24+
how to convert one to the other) consult the following guides. Material Style
25+
Guide RTL Styling Guide
26+
- As a general rule try to adhere to the following rules, but there may be times
27+
when it’s not possible. In that case at least confirm that the site renders
28+
reasonably in RTL as well as LTR. Reach out for help if you need it.
29+
- Combine selectors with redundant rules.
30+
- Use shorthand css rules where applicable.
31+
- Remove unused CSS rulesets.
32+
33+
### Prefer using:
34+
- Flex and Grid Layouts have great inherent RTL support. When building out new
35+
components, use them wherever possible.
36+
- Left and right margins should be equal whenever possible
37+
- Alignment properties (align-items, justify-content, etc) versus padding and
38+
margin to align content CSS overrides using specificity (example: .test
39+
.test2 overrides .test2)
40+
41+
### Avoid using:
42+
- CSS “float”
43+
- Positioning elements (eg: fixed, absolute, etc..) that break RTL or responsive guidelines
44+
- Negative margins and negative padding
45+
- Empty rulesets
46+
- !important - it interrupts natural CSS overrides

0 commit comments

Comments
 (0)