diff --git a/frontend/src/asset/style/art-bg-example.png b/frontend/src/asset/style/art-bg-example.png new file mode 100644 index 0000000..238eb57 Binary files /dev/null and b/frontend/src/asset/style/art-bg-example.png differ diff --git a/frontend/src/asset/style/eckles-img-example.png b/frontend/src/asset/style/eckles-img-example.png new file mode 100644 index 0000000..0eec867 Binary files /dev/null and b/frontend/src/asset/style/eckles-img-example.png differ diff --git a/frontend/src/asset/style/eslint-error.png b/frontend/src/asset/style/eslint-error.png new file mode 100644 index 0000000..5c90cc4 Binary files /dev/null and b/frontend/src/asset/style/eslint-error.png differ diff --git a/frontend/src/asset/style/eslint-success.png b/frontend/src/asset/style/eslint-success.png new file mode 100644 index 0000000..bfcdb7f Binary files /dev/null and b/frontend/src/asset/style/eslint-success.png differ diff --git a/frontend/src/asset/style/guardian-img-example.png b/frontend/src/asset/style/guardian-img-example.png new file mode 100644 index 0000000..cfc6133 Binary files /dev/null and b/frontend/src/asset/style/guardian-img-example.png differ diff --git a/frontend/src/asset/style/moodle-bg-example.png b/frontend/src/asset/style/moodle-bg-example.png new file mode 100644 index 0000000..e828e5a Binary files /dev/null and b/frontend/src/asset/style/moodle-bg-example.png differ diff --git a/frontend/src/component/StyleComponents.jsx b/frontend/src/component/StyleComponents.jsx index 979e59e..e97be38 100644 --- a/frontend/src/component/StyleComponents.jsx +++ b/frontend/src/component/StyleComponents.jsx @@ -1,6 +1,7 @@ import React from 'react'; import Typography from '@mui/material/Typography'; import Divider from '@mui/material/Divider'; +import Box from '@mui/material/Box'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { a11yDark } from 'react-syntax-highlighter/dist/esm/styles/hljs'; @@ -52,7 +53,7 @@ export const Example = (props) => { <>
setExpand(!expand)}> - {expand ? '⬇️' : '⬆️'} 💡 Example: + {expand ? '⬇️' : '⬆️'} 💡 {`${(props.title ?? 'Example')}:`} {expand ? ( @@ -68,7 +69,7 @@ export const Example = (props) => { {props.goods && props.goods.map((good, idx) => { return ( <> - 🟢 Good + 🟢 Good{good}
>
)
@@ -79,4 +80,38 @@ export const Example = (props) => {
)}
>
)
-}
\ No newline at end of file
+}
+
+export const ExampleImages = ({ title, srcArray = [] }) => {
+ const [expand, setExpand] = React.useState(true);
+
+ return (
+ <>
+ setExpand(!expand)}>
+
+ {expand ? '⬇️' : '⬆️'} 💡 {`${(title ?? 'Example')}:`}
+
+
+ {expand ? (
+ srcArray.map((asset, idx) => (
+ {'{'}
and decrease it when we use a closing brace }
. We also go to a new line with each semicolon ;
.
+ As long as you're consistent, you may use 2-space or 4-space indentation in CSS files. We increase the indentation level everytime we use an opening brace {'{'}
and decrease it when we use a closing brace {'}'}
. We also go to a new line with each semicolon ;
.
*
selector to prevent unintended side effects, such as unintentionally overriding the margin property of an element that you want a different margin set.
+ However, an exception will be made if they are solely used to modify the default settings for box-sizing
, margin
or padding
.
{`
-
-
+
+
+
`}
@@ -229,7 +234,7 @@ const StyleHtml = ({}) => {
.css
file - **stick to external styling**. See below under the [CSS section](#css-external-spreadsheet) for reasons why.
+ You should always try and avoid inline/internal styling and keep all CSS styles in a separate .css
file - stick to external styling. See below under the [CSS section](#css-external-spreadsheet) for reasons why.
with another tag styled with background-image
, there's a clear distinction between the two.
+ While you can interchange {''}
with another tag styled with background-image
, there's a clear distinction between the two.
- background-image
as the name implies is for setting an image in the **background** (i.e., there could be text or other elements obscuring the image). These are normally reserved for decoration and making the website visually appealing.
+ background-image
as the name implies is for setting an image in the background (i.e., there could be text or other elements obscuring the image). These are normally reserved for decoration and making the website visually appealing.
- On the other hand, a
tag is for setting an image in the **foreground** and is used for salient images (i.e., nothing is obscuring it and is part of the website flow/layout). These are used for displaying content that is to be consumed by users.
+ On the other hand, a {''}
tag is for setting an image in the foreground and is used for salient images (i.e., nothing is obscuring it and is part of the website flow/layout). These are used for displaying content that is to be consumed by users.
Getting these mixed up will impact: