Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 16ea780

Browse files
committed
Merge pull request #38 from mobify/hybrid-projects
Hybrid projects
2 parents 03f43fa + 39ac6da commit 16ea780

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

css/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
* [When to use their existing selectors](class-naming-conventions#when-to-use-their-existing-selectors)
3939
* [How to use their existing selectors in our components](class-naming-conventions#how-to-use-their-existing-selectors-in-our-components)
4040
* [Block Comment Documentation Guide](comments/Readme.md)
41+
* [Hybrid Projects Best Practices](hybrid-projects/Readme.md)
4142

4243
Continue on to [the Introduction →](introduction#introduction)

css/comments/Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,5 @@ An example of both the doc block and dependencies can be seen here:
418418
@return $value + $modifier;
419419
}
420420
```
421+
422+
Continue on to [Hybrid App Projects →](../hybrid-projects#hybrid-app-projects)

css/hybrid-projects/Readme.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Hybrid App Projects
2+
3+
## Structuring App Styles For a Legacy Mobify Site
4+
5+
CSS written specifically for webviews contained in a Native application should follow all normally prescribed [best practices](https://github.com/mobify/mobify-code-style/tree/master/css/css-best-practices). This page will outline how to start a new app project, avoid adhering to legacy CSS code style, and provide a minimally sized CSS file to the web.
6+
7+
A hybrid project has a stylesheet specific to the OS. So a typical app project for a legacy Mobify project would be structured as such:
8+
9+
```
10+
/styles
11+
/vellum
12+
/components
13+
/partials
14+
/templates
15+
16+
/ios
17+
/components
18+
/partials
19+
/templates
20+
21+
/android
22+
/components
23+
/partials
24+
/templates
25+
26+
stylesheet.scss
27+
ios.scss
28+
android.scss
29+
```
30+
31+
``android.css`` will include all of the web styles and override them as needed. Building on top of whats there with all the styles specific to that OS will help in keeping the system maintainable. The system used to build out an example ``android.css`` would look something like this:
32+
33+
```scss
34+
// Android Styles
35+
// ===
36+
37+
38+
// Web Base Styles
39+
// ---
40+
41+
@import stylesheet.scss
42+
43+
44+
// Components
45+
// ---
46+
47+
@import 'android/components/arrange';
48+
@import 'android/components/card';
49+
@import 'android/components/stack';
50+
51+
52+
// Templates
53+
// ---
54+
55+
@import 'android/templates/login';
56+
@import 'android/templates/store-finder';
57+
@import 'android/templates/store-details';
58+
@import 'android/templates/search-error';
59+
```
60+
61+
Stylesheets will be generated and served to the page depending on the context. If it’s an android app it gets ``android.css``, if its a website it gets ``stylesheet.css``, etc.
62+
63+
## Structuring App Styles For a New Mobify Site
64+
65+
The current intended strategy in mind for future new builds is to have a single stylesheet for all platforms. Incorporating platform-specific theming and components into our existing CSS system.
66+
67+
This could serve to decrease the complexity associated with the system we use for legacy Mobify sites and potentially make hybrid projects easier to maintain.

0 commit comments

Comments
 (0)