0-readme edit
wm-atomic-docs
edit
Overview of the system and how the Content Type templates and examples, etc are set up
W&M Atomic Docs
A documentation and reference library for all HTML/CSS/Javascript in the W&M website. Also includes a local site for development work.
- Built using Atomic Docs, which is a style generator and component manager app, as a base.
- provides a GUI for handling the creation of the Sass and HTML partial files associated with the components
- does the "wiring together" of the Sass partials (i.e. automatically creates all the @import files needed and connects them all to main.scss.
- organizes all the components under customizable category names
- Extended to include a local test site with All The ExamplesTM (literally there are examples of everything)
- local site html mimics the Content Type and template structure of Cascade to enable easier testing and updates
Benefits of the Atomic Docs and local test site system
- Uses git so change history is readily available and deployment is easy.
- Enables development on your local computer, which is much faster than Cascade.
- Provides an easy-to-use reference point and documentation for W&M's website code.
- Enables use of external libraries like Sass which gives functions and includes to CSS, and PHP which aids in testing.
- Makes it easy to update and modify component structure and local site code.
Local Test Site Structure
The local test site is created by outputting elements from Atomic Docs into code that mimics the pages in Cascade.
- main-layout.php provides the main html structure. It then pulls in a Content Type (determined by a query in the url), which, in turn, pulls in the page template which then pulls in the page content.
- The Content Type pages are set up to match the Content Types in Cascade as much as possible.
- Likewise, the Template pages are set up to match the Templates in Cascade.
- main-layout is also set up to be able to view rows without the surrounding site, in order to save time during development.
- The Paste-N-Test-Page.php page template allows the developer to copy code from the live site and paste it into the local site to make for faster debugging.
The atomic-head.php file sets up the variables and functions used in the templating system:
- base path url variable for font and image locations depending on site's url
- functions to output elements from Atomic Docs into local test site
- outputMenu - pulls from menu folder
- outputElement - pulls from page content element folder
- outputContent - pulls from page content folder
- outputTemplate - pulls from templates folder
- outputRow - pulls from rows folder
- outputComponent - pulls from base components folder
- stylesheet and font links
SCSS/CSS
The site uses multiple Sass functions, mixins, and Sass and CSS variables to maintain consistency.
- Colors
- Detailed information can be found here
- Color themes
- Detailed information can be found here
- Fonts
- The font() function pulls values from the font map (wm-fonts.scss).
- Spacing
- The kspaces() function pulls values from the spacing map (wm-spacing.scss). These values are used most of the time, but there are some custom ones scattered about. There are also some variables that get used.
- Breakpoints
- The breakpoint mixin pulls values from the breakpoint map (wm-breakpoint.scss). These values are used most of the time, but there are some custom ones scattered about.
- Some widths and heights
- Straight Sass variables
- Button styles
- Includes for each type of button style
- Divider border
- Straight Sass variables
Other Sass functions include
- Converting px to rem (not used very consistently :/)
- Banner heights
- Fluid sizing (not very precise, but can be useful)
- Right arrow
The CSS is compiled from SCSS by the Scout-App app whenever a page is saved.
- Input: /scss/main.scss
- Output: /prod/main.css and main.css.map